Skip to content

Commit 864d4f6

Browse files
author
Igor Melnikov
committed
Merge remote-tracking branch 'upstream/develop' into create-default-hydrator
2 parents 23e33eb + 2f91db8 commit 864d4f6

File tree

8 files changed

+62
-26
lines changed

8 files changed

+62
-26
lines changed

app/code/Magento/Backend/view/adminhtml/templates/page/js/calendar.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ require([
5050
showTime: false,
5151
showHour: false,
5252
showMinute: false,
53+
serverTimezoneSeconds: <?php echo (int) $block->getStoreTimestamp(); ?>,
5354
yearRange: '<?php /* @escapeNotVerified */ echo $block->getYearRange() ?>'
5455
}
5556
});

app/code/Magento/Backend/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
</field>
7575
<field name="theme">
7676
<argument name="data" xsi:type="array">
77-
<item name="options" xsi:type="object">Magento\Framework\View\Design\Theme\Label</item>
77+
<item name="options" xsi:type="object">Magento\Theme\Model\Design\Theme\Label</item>
7878
<item name="config" xsi:type="array">
7979
<item name="formElement" xsi:type="string">select</item>
8080
<item name="dataType" xsi:type="string">text</item>

app/code/Magento/Catalog/view/adminhtml/web/js/bundle-proxy-button.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ define([
5454
return this;
5555
},
5656

57+
/**
58+
* Calls 'destroy' of parent and
59+
* clear listing provider source
60+
*
61+
* @returns {Object} Chainable.
62+
*/
63+
destroy: function () {
64+
this._super();
65+
this.source.set(this.listingDataProvider, []);
66+
67+
return this;
68+
},
69+
5770
/**
5871
* Call parent "action" method
5972
* and set new data to record and listing.

app/code/Magento/Sales/Model/ResourceModel/Order/Item/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected function _afterLoad()
5555
* Assign parent items
5656
*/
5757
foreach ($this as $item) {
58+
$this->_resource->unserializeFields($item);
5859
if ($item->getParentItemId()) {
5960
$item->setParentItem($this->getItemById($item->getParentItemId()));
6061
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Theme\Model\Design\Theme;
7+
8+
class Label extends \Magento\Framework\View\Design\Theme\Label
9+
{
10+
/**
11+
* Return labels collection array
12+
*
13+
* @param bool|string $label add empty values to result with specific label
14+
* @return array
15+
*/
16+
public function getLabelsCollection($label = false)
17+
{
18+
$options = parent::getLabelsCollection();
19+
if ($label) {
20+
array_unshift($options, ['value' => 0, 'label' => $label]);
21+
}
22+
return $options;
23+
}
24+
}

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,6 @@ define([
556556
this.setMaxPosition();
557557
}
558558

559-
elems.forEach(function (record) {
560-
_.where(record.elems(),
561-
{
562-
formElement: 'select'
563-
}).forEach(function (elem) {
564-
elem.value(undefined);
565-
});
566-
});
567-
568559
path = this.dataScope + '.' + this.index + '.' + (this.startIndex + idx);
569560
this.source.set(path, rec);
570561
}, this);

lib/internal/Magento/Framework/Session/SessionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public function regenerateId()
470470
return $this;
471471
}
472472
if ($this->isSessionExists()) {
473-
session_regenerate_id(true);
473+
session_regenerate_id(false);
474474
} else {
475475
session_start();
476476
}

lib/web/mage/calendar.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,15 @@
7575
var self = this;
7676

7777
/**
78-
* overwrite jQuery UI datepicker function.
78+
* Overwrite jQuery UI datepicker function.
79+
* Reason: magento date could be set before calendar show
80+
* but local date will be styled as current in original _generateHTML
81+
*
7982
* @param {Object} inst - instance datepicker.
8083
* @return {String} html template
8184
*/
8285
$.datepicker.constructor.prototype._generateHTML = function (inst) {
83-
var today = this._daylightSavingAdjust(self.getTimezoneDate()),
86+
var today = self.getTimezoneDate(),
8487
isRTL = this._get(inst, 'isRTL'),
8588
showButtonPanel = this._get(inst, 'showButtonPanel'),
8689
hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'),
@@ -315,17 +318,20 @@
315318

316319
/**
317320
* If server timezone is defined then take to account server timezone shift
318-
* @param {Object} date
319321
* @return {Object} date
320322
*/
321-
getTimezoneDate: function (date) {
322-
date = date || new Date();
323+
getTimezoneDate: function () {
323324

324-
if (this.options.serverTimezoneSeconds) {
325-
date.setTime((this.options.serverTimezoneSeconds + date.getTimezoneOffset() * 60) * 1000);
325+
// Get local time in ms
326+
var ms = Date.now();
327+
328+
// Use store timestamp based on store timezone settings
329+
if (typeof this.options.serverTimezoneSeconds !== 'undefined') {
330+
//Adjust milliseconds according to client local timezone offset
331+
ms = (this.options.serverTimezoneSeconds + new Date().getTimezoneOffset() * 60) * 1000;
326332
}
327333

328-
return date;
334+
return new Date(ms);
329335
},
330336

331337
/**
@@ -396,10 +402,7 @@
396402
'yy': 'yy' // Always long year format on frontend
397403
},
398404
time: {
399-
'a': 'TT',
400-
'H': 'h',
401-
'MM': 'mm',
402-
'SS': 'ss'
405+
'a': 'TT'
403406
}
404407
},
405408

@@ -518,9 +521,12 @@
518521
* @param {Object} el
519522
*/
520523
$.datepicker._gotoToday = function (el) {
521-
$.datepicker._gotoTodayOriginal.call(this, el);
522-
$.datepicker._selectDate.call(this, el);
523-
$(el).blur(); // To ensure that user can re-select date field without clicking outside it first.
524+
var pickerObject = $(el);
525+
526+
// Set date/time according to timezone offset
527+
pickerObject.datepicker( "setDate", pickerObject.calendar("getTimezoneDate") )
528+
// To ensure that user can re-select date field without clicking outside it first.
529+
.blur();
524530
};
525531

526532
return {

0 commit comments

Comments
 (0)