Skip to content

Commit 9c387e3

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1275 from magento-engcom/develop-prs
#10126 #10105 #10094 #9189 #7174 #10149 #10151 #10140
2 parents 694a66b + ee3cd0f commit 9c387e3

File tree

32 files changed

+326
-95
lines changed

32 files changed

+326
-95
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getHtml()
131131
public function getEscapedValue($index = null)
132132
{
133133
$value = $this->getValue($index);
134-
if ($value instanceof \DateTime) {
134+
if ($value instanceof \DateTimeInterface) {
135135
return $this->dateTimeFormatter->formatObject(
136136
$value,
137137
$this->_localeDate->getDateFormat(\IntlDateFormatter::SHORT)

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getEscapedValue($index = null)
147147
{
148148
if ($this->getColumn()->getFilterTime()) {
149149
$value = $this->getValue($index);
150-
if ($value instanceof \DateTime) {
150+
if ($value instanceof \DateTimeInterface) {
151151
return $this->_localeDate->formatDateTime($value);
152152
}
153153
return $value;

app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ protected function _afterDelete(\Magento\Framework\Model\AbstractModel $rule)
153153
* Get catalog rules product price for specific date, website and
154154
* customer group
155155
*
156-
* @param \DateTime $date
156+
* @param \DateTimeInterface $date
157157
* @param int $wId
158158
* @param int $gId
159159
* @param int $pId
@@ -173,13 +173,13 @@ public function getRulePrice($date, $wId, $gId, $pId)
173173
* Retrieve product prices by catalog rule for specific date, website and customer group
174174
* Collect data with product Id => price pairs
175175
*
176-
* @param \DateTime $date
176+
* @param \DateTimeInterface $date
177177
* @param int $websiteId
178178
* @param int $customerGroupId
179179
* @param array $productIds
180180
* @return array
181181
*/
182-
public function getRulePrices(\DateTime $date, $websiteId, $customerGroupId, $productIds)
182+
public function getRulePrices(\DateTimeInterface $date, $websiteId, $customerGroupId, $productIds)
183183
{
184184
$connection = $this->getConnection();
185185
$select = $connection->select()

app/code/Magento/Customer/Setup/UpgradeData.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
155155
);
156156
}
157157

158+
if (version_compare($context->getVersion(), '2.0.12', '<')) {
159+
$this->upgradeVersionTwoZeroTwelve($customerSetup);
160+
}
161+
158162
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
159163
$indexer->reindexAll();
160164
$this->eavConfig->clear();
@@ -636,6 +640,15 @@ private function upgradeVersionTwoZeroSeven($customerSetup)
636640
);
637641
}
638642

643+
/**
644+
* @param CustomerSetup $customerSetup
645+
* @return void
646+
*/
647+
private function upgradeVersionTwoZeroTwelve(CustomerSetup $customerSetup)
648+
{
649+
$customerSetup->updateAttribute('customer_address', 'vat_id', 'frontend_label', 'VAT Number');
650+
}
651+
639652
/**
640653
* @param ModuleDataSetupInterface $setup
641654
* @return void

app/code/Magento/Customer/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Customer" setup_version="2.0.11">
9+
<module name="Magento_Customer" setup_version="2.0.12">
1010
<sequence>
1111
<module name="Magento_Eav"/>
1212
<module name="Magento_Directory"/>

app/code/Magento/Eav/Model/Entity/Attribute/Backend/Datetime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function beforeSave($object)
6565
* string format used from input fields (all date input fields need apply locale settings)
6666
* int value can be declared in code (this meen whot we use valid date)
6767
*
68-
* @param string|int|\DateTime $date
68+
* @param string|int|\DateTimeInterface $date
6969
* @return string
7070
*/
7171
public function formatDate($date)
@@ -76,7 +76,7 @@ public function formatDate($date)
7676
// unix timestamp given - simply instantiate date object
7777
if (is_scalar($date) && preg_match('/^[0-9]+$/', $date)) {
7878
$date = (new \DateTime())->setTimestamp($date);
79-
} elseif (!($date instanceof \DateTime)) {
79+
} elseif (!($date instanceof \DateTimeInterface)) {
8080
// normalized format expecting Y-m-d[ H:i:s] - time is optional
8181
$date = new \DateTime($date);
8282
}

app/code/Magento/Indexer/Model/Mview/View/State.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function getUpdated()
140140
/**
141141
* Set state updated time
142142
*
143-
* @param string|int|\DateTime $updated
143+
* @param string|int|\DateTimeInterface $updated
144144
* @return $this
145145
*/
146146
public function setUpdated($updated)

app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ define(['jquery', 'jquery/ui'], function ($) {
332332
.attr('webkitallowfullscreen', '')
333333
.attr('mozallowfullscreen', '')
334334
.attr('allowfullscreen', '')
335+
.attr('referrerPolicy', 'origin')
335336
);
336337
this._player = window.$f(this.element.children(':first')[0]);
337338

app/code/Magento/Reports/Model/ResourceModel/Report/AbstractReport.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ protected function _clearTableByDateRange(
188188
* @param string $table
189189
* @param string $column
190190
* @param string $whereColumn
191-
* @param null|string|\DateTime $from
192-
* @param null|string|\DateTime $to
191+
* @param null|string|\DateTimeInterface $from
192+
* @param null|string|\DateTimeInterface $to
193193
* @param [][] $additionalWhere
194194
* @param string $alias
195195
* @return \Magento\Framework\DB\Select
@@ -440,12 +440,12 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null)
440440
$tzTransitions = [];
441441
try {
442442
if (!empty($from)) {
443-
$from = $from instanceof \DateTime
443+
$from = $from instanceof \DateTimeInterface
444444
? $from->getTimestamp()
445445
: (new \DateTime($from))->getTimestamp();
446446
}
447447

448-
$to = $to instanceof \DateTime
448+
$to = $to instanceof \DateTimeInterface
449449
? $to
450450
: new \DateTime($to);
451451
$nextPeriod = $this->getConnection()->formatDate(

app/code/Magento/Reports/Model/ResourceModel/Report/Collection.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class Collection extends \Magento\Framework\Data\Collection
1919
/**
2020
* From value
2121
*
22-
* @var string
22+
* @var \DateTime
2323
*/
2424
protected $_from;
2525

2626
/**
2727
* To value
2828
*
29-
* @var string
29+
* @var \DateTime
3030
*/
3131
protected $_to;
3232

@@ -114,14 +114,14 @@ public function setPeriod($period)
114114
* Set interval
115115
* @codeCoverageIgnore
116116
*
117-
* @param \DateTime $fromDate
118-
* @param \DateTime $toDate
117+
* @param \DateTimeInterface $fromDate
118+
* @param \DateTimeInterface $toDate
119119
* @return $this
120120
*/
121-
public function setInterval($fromDate, $toDate)
121+
public function setInterval(\DateTimeInterface $fromDate, \DateTimeInterface $toDate)
122122
{
123-
$this->_from = $fromDate;
124-
$this->_to = $toDate;
123+
$this->_from = new \DateTime($fromDate->format('Y-m-d'), $fromDate->getTimezone());
124+
$this->_to = new \DateTime($toDate->format('Y-m-d'), $toDate->getTimezone());
125125

126126
return $this;
127127
}

0 commit comments

Comments
 (0)