Skip to content

Commit 0f9b4f8

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-99171
2 parents c99291d + 1fc17af commit 0f9b4f8

File tree

125 files changed

+1659
-2051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1659
-2051
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/helper/gallery.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ $formName = $block->getFormName();
173173
<label class="admin__field-label">
174174
<span><?= $block->escapeHtml(__('Image Size')) ?></span>
175175
</label>
176-
<div class="admin__field-value" data-message="<?= $block->escapeHtmlAttr(_('{size}')) ?>"></div>
176+
<div class="admin__field-value" data-message="<?= $block->escapeHtmlAttr(__('{size}')) ?>"></div>
177177
</div>
178178

179179
<div class="admin__field admin__field-inline field-image-resolution" data-role="resolution">

app/code/Magento/CatalogInventory/Helper/Minsaleqty.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function serializeValue($value)
9595
}
9696
return $this->serializer->serialize($data);
9797
} else {
98-
return '';
98+
return $value;
9999
}
100100
}
101101

app/code/Magento/CatalogInventory/Test/Unit/Helper/MinsaleqtyTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public function testMakeStorableArrayFieldValue($value, $result, $serializeCallC
216216
public function makeStorableArrayFieldValueDataProvider()
217217
{
218218
return [
219-
'invalid bool' => [false, ''],
219+
'invalid bool' => [false, false],
220220
'invalid empty string' => ['', ''],
221221
'valid numeric' => ['22', '22'],
222222
'valid empty array' => [[], '[]', 1],
@@ -240,7 +240,8 @@ public function makeStorableArrayFieldValueDataProvider()
240240
'[1]',
241241
1,
242242
[0 => 1.0]
243-
]
243+
],
244+
'json value' => ['{"32000":2,"0":1}', '{"32000":2,"0":1}'],
244245
];
245246
}
246247
}

app/code/Magento/Checkout/view/frontend/templates/onepage/failure.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<p><?= $block->escapeHtml($error) ?></p>
1414
<?php endif ?>
1515
<p><?= $block->escapeHtml(
16-
_('Click <a href="%1">here</a> to continue shopping.', $block->escapeUrl($block->getContinueShoppingUrl())),
16+
__('Click <a href="%1">here</a> to continue shopping.', $block->escapeUrl($block->getContinueShoppingUrl())),
1717
['a']
1818
) ?>
1919
</p>

app/code/Magento/Reports/Model/ResourceModel/Product/Sold/Collection.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
use Magento\Framework\DB\Select;
1515

1616
/**
17+
* Data collection.
18+
*
1719
* @SuppressWarnings(PHPMD.DepthOfInheritance)
1820
* @api
1921
* @since 100.0.2
2022
*/
2123
class Collection extends \Magento\Reports\Model\ResourceModel\Order\Collection
2224
{
2325
/**
24-
* Set Date range to collection
26+
* Set Date range to collection.
2527
*
2628
* @param int $from
2729
* @param int $to
@@ -79,6 +81,10 @@ public function addOrderedQty($from = '', $to = '')
7981
)->having(
8082
'order_items.qty_ordered > ?',
8183
0
84+
)->columns(
85+
'SUM(order_items.qty_ordered) as ordered_qty'
86+
)->group(
87+
'order_items.product_id'
8288
);
8389
return $this;
8490
}
@@ -116,6 +122,8 @@ public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
116122
}
117123

118124
/**
125+
* @inheritdoc
126+
*
119127
* @return Select
120128
* @since 100.2.0
121129
*/

app/code/Magento/Sales/view/adminhtml/templates/items/column/name.phtml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,31 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<?php
11-
/**
12-
* @see \Magento\Sales\Block\Adminhtml\Items\Column\Name
13-
*/
10+
/* @var $block \Magento\Sales\Block\Adminhtml\Items\Column\Name */
1411
?>
15-
16-
<?php if ($_item = $block->getItem()): ?>
17-
<div id="order_item_<?= $block->escapeHtml($_item->getId()) ?>_title"
12+
<?php if ($_item = $block->getItem()) : ?>
13+
<div id="order_item_<?= (int) $_item->getId() ?>_title"
1814
class="product-title">
1915
<?= $block->escapeHtml($_item->getName()) ?>
2016
</div>
2117
<div class="product-sku-block">
22-
<span><?= $block->escapeHtml(__('SKU'))?>:</span> <?= implode('<br />', $this->helper('Magento\Catalog\Helper\Data')->splitSku($block->escapeHtml($block->getSku()))) ?>
18+
<span><?= $block->escapeHtml(__('SKU'))?>:</span> <?= /* @noEscape */ implode('<br />', $this->helper(\Magento\Catalog\Helper\Data::class)->splitSku($block->escapeHtml($block->getSku()))) ?>
2319
</div>
2420

25-
<?php if ($block->getOrderOptions()): ?>
21+
<?php if ($block->getOrderOptions()) : ?>
2622
<dl class="item-options">
27-
<?php foreach ($block->getOrderOptions() as $_option): ?>
23+
<?php foreach ($block->getOrderOptions() as $_option) : ?>
2824
<dt><?= $block->escapeHtml($_option['label']) ?>:</dt>
2925
<dd>
30-
<?php if (isset($_option['custom_view']) && $_option['custom_view']): ?>
31-
<?= /* @escapeNotVerified */ $block->getCustomizedOptionValue($_option) ?>
32-
<?php else: ?>
26+
<?php if (isset($_option['custom_view']) && $_option['custom_view']) : ?>
27+
<?= /* @noEscape */ $block->getCustomizedOptionValue($_option) ?>
28+
<?php else : ?>
3329
<?php $_option = $block->getFormattedOption($_option['value']); ?>
3430
<?= $block->escapeHtml($_option['value']) ?>
35-
<?php if (isset($_option['remainder']) && $_option['remainder']): ?>
31+
<?php if (isset($_option['remainder']) && $_option['remainder']) : ?>
3632
<?php $dots = 'dots' . uniqid(); ?>
3733
<span id="<?= /* @noEscape */ $dots; ?>"> ...</span>
3834
<?php $id = 'id' . uniqid(); ?>

app/code/Magento/Sales/view/adminhtml/templates/items/column/qty.phtml

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,41 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
10-
<?php if ($item = $block->getItem()): ?>
11-
<table class="qty-table">
12-
<tr>
13-
<th><?= $block->escapeHtml(__('Ordered')); ?></th>
14-
<td><?= /* @noEscape */ $item->getQtyOrdered()*1 ?></td>
15-
</tr>
16-
17-
<?php if ((float) $item->getQtyInvoiced()): ?>
7+
<?php if ($item = $block->getItem()) : ?>
8+
<table class="qty-table">
189
<tr>
19-
<th><?= $block->escapeHtml(__('Invoiced')); ?></th>
20-
<td><?= /* @noEscape */ $item->getQtyInvoiced()*1 ?></td>
10+
<th><?= $block->escapeHtml(__('Ordered')); ?></th>
11+
<td><?= (int) $item->getQtyOrdered() ?></td>
2112
</tr>
22-
<?php endif; ?>
2313

24-
<?php if ((float) $item->getQtyShipped()): ?>
25-
<tr>
26-
<th><?= $block->escapeHtml(__('Shipped')); ?></th>
27-
<td><?= /* @noEscape */ $item->getQtyShipped()*1 ?></td>
28-
</tr>
29-
<?php endif; ?>
14+
<?php if ((float)$item->getQtyInvoiced()) : ?>
15+
<tr>
16+
<th><?= $block->escapeHtml(__('Invoiced')); ?></th>
17+
<td><?= (int) $item->getQtyInvoiced() ?></td>
18+
</tr>
19+
<?php endif; ?>
3020

31-
<?php if ((float) $item->getQtyRefunded()): ?>
32-
<tr>
33-
<th><?= $block->escapeHtml(__('Refunded')); ?></th>
34-
<td><?= /* @noEscape */ $item->getQtyRefunded()*1 ?></td>
35-
</tr>
36-
<?php endif; ?>
21+
<?php if ((float)$item->getQtyShipped()) : ?>
22+
<tr>
23+
<th><?= $block->escapeHtml(__('Shipped')); ?></th>
24+
<td><?= (int) $item->getQtyShipped() ?></td>
25+
</tr>
26+
<?php endif; ?>
3727

38-
<?php if ((float) $item->getQtyCanceled()): ?>
39-
<tr>
40-
<th><?= $block->escapeHtml(__('Canceled')); ?></th>
41-
<td><?= /* @noEscape */ $item->getQtyCanceled()*1 ?></td>
42-
</tr>
43-
<?php endif; ?>
28+
<?php if ((float)$item->getQtyRefunded()) : ?>
29+
<tr>
30+
<th><?= $block->escapeHtml(__('Refunded')); ?></th>
31+
<td><?= (int) $item->getQtyRefunded() ?></td>
32+
</tr>
33+
<?php endif; ?>
34+
35+
<?php if ((float)$item->getQtyCanceled()) : ?>
36+
<tr>
37+
<th><?= $block->escapeHtml(__('Canceled')); ?></th>
38+
<td><?= (int) $item->getQtyCanceled() ?></td>
39+
</tr>
40+
<?php endif; ?>
4441

45-
</table>
42+
</table>
4643
<?php endif; ?>

app/code/Magento/Sales/view/adminhtml/templates/items/price/row.phtml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php
118
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
12-
139
$_item = $block->getItem();
1410
?>
15-
1611
<div class="price-excl-tax">
17-
<?= /* @escapeNotVerified */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
12+
<?= /* @noEscape */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
1813
</div>

app/code/Magento/Sales/view/adminhtml/templates/items/price/total.phtml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable PSR2.Files.ClosingTag
98
?>
109
<?php
1110
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
12-
1311
$_item = $block->getItem();
1412
?>
15-
16-
<?= /* @escapeNotVerified */ $block->displayPrices($block->getBaseTotalAmount($_item), $block->getTotalAmount($_item)) ?>
13+
<?= /* @noEscape */ $block->displayPrices($block->getBaseTotalAmount($_item), $block->getTotalAmount($_item)) ?>

app/code/Magento/Sales/view/adminhtml/templates/items/price/unit.phtml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php
118
/** @var \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $block */
12-
139
$_item = $block->getItem();
1410
?>
1511
<div class="price-excl-tax">
16-
<?= /* @escapeNotVerified */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
12+
<?= /* @noEscape */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
1713
</div>

0 commit comments

Comments
 (0)