Skip to content

Commit f0d995f

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-86143
2 parents da7a363 + 44502ff commit f0d995f

File tree

15 files changed

+308
-193
lines changed

15 files changed

+308
-193
lines changed

app/code/Magento/Catalog/view/base/web/js/price-options.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ define([
2020
optionConfig: {},
2121
optionHandlers: {},
2222
optionTemplate: '<%= data.label %>' +
23-
'<% if (data.finalPrice.value) { %>' +
23+
'<% if (data.finalPrice.value > 0) { %>' +
2424
' +<%- data.finalPrice.formatted %>' +
25+
'<% } else if (data.finalPrice.value < 0) { %>' +
26+
' <%- data.finalPrice.formatted %>' +
2527
'<% } %>',
2628
controlContainer: 'dd'
2729
};

app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,6 @@ define([
1919
menuContainer: '[data-action="navigation"] > ul'
2020
},
2121

22-
/** @inheritdoc */
23-
_init: function () {
24-
var menu;
25-
26-
// render breadcrumbs after navigation menu is loaded.
27-
menu = $(this.options.menuContainer).data('mageMenu');
28-
29-
if (typeof menu === 'undefined') {
30-
this._on($(this.options.menuContainer), {
31-
'menucreate': this._super
32-
});
33-
} else {
34-
this._super();
35-
}
36-
},
37-
3822
/** @inheritdoc */
3923
_render: function () {
4024
this._appendCatalogCrumbs();
@@ -87,18 +71,10 @@ define([
8771
* @private
8872
*/
8973
_getCategoryCrumb: function (menuItem) {
90-
var categoryId,
91-
categoryName,
92-
categoryUrl;
93-
94-
categoryId = /(\d+)/i.exec(menuItem.attr('id'))[0];
95-
categoryName = menuItem.text();
96-
categoryUrl = menuItem.attr('href');
97-
9874
return {
99-
'name': 'category' + categoryId,
100-
'label': categoryName,
101-
'link': categoryUrl,
75+
'name': 'category',
76+
'label': menuItem.text(),
77+
'link': menuItem.attr('href'),
10278
'title': ''
10379
};
10480
},

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,9 @@ protected function cancelDesignConfig()
534534
*/
535535
public function setForcedArea($templateId)
536536
{
537-
if ($this->area) {
538-
throw new \LogicException(__('Area is already set'));
537+
if (!isset($this->area)) {
538+
$this->area = $this->emailConfig->getTemplateArea($templateId);
539539
}
540-
$this->area = $this->emailConfig->getTemplateArea($templateId);
541540
return $this;
542541
}
543542

app/code/Magento/ImportExport/Model/Import/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ public function validateData()
831831
if (!$this->isAttributeParticular($columnName)) {
832832
if (trim($columnName) == '') {
833833
$emptyHeaderColumns[] = $columnNumber;
834-
} elseif (!preg_match('/^[a-z][a-z0-9_]*$/', $columnName)) {
834+
} elseif (!preg_match('/^[a-z][\w]*$/u', $columnName)) {
835835
$invalidColumns[] = $columnName;
836836
} elseif ($this->needColumnCheck && !in_array($columnName, $this->getValidColumnNames())) {
837837
$invalidAttributes[] = $columnName;

app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ public function validateData()
803803
if (!$this->isAttributeParticular($columnName)) {
804804
if (trim($columnName) == '') {
805805
$emptyHeaderColumns[] = $columnNumber;
806-
} elseif (!preg_match('/^[a-z][a-z0-9_]*$/', $columnName)) {
806+
} elseif (!preg_match('/^[a-z][\w]*$/u', $columnName)) {
807807
$invalidColumns[] = $columnName;
808808
} elseif ($this->needColumnCheck && !in_array($columnName, $this->getValidColumnNames())) {
809809
$invalidAttributes[] = $columnName;

app/code/Magento/Sales/Model/Order/ItemRepository.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public function get($id)
114114
}
115115

116116
$this->addProductOption($orderItem);
117+
$this->addParentItem($orderItem);
117118
$this->registry[$id] = $orderItem;
118119
}
119120
return $this->registry[$id];
@@ -213,6 +214,20 @@ protected function addProductOption(OrderItemInterface $orderItem)
213214
return $this;
214215
}
215216

217+
/**
218+
* Set parent item.
219+
*
220+
* @param OrderItemInterface $orderItem
221+
* @throws InputException
222+
* @throws NoSuchEntityException
223+
*/
224+
private function addParentItem(OrderItemInterface $orderItem)
225+
{
226+
if ($parentId = $orderItem->getParentItemId()) {
227+
$orderItem->setParentItem($this->get($parentId));
228+
}
229+
}
230+
216231
/**
217232
* Set product options data
218233
*

app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,23 @@ protected function clearValues(Address\Total $total)
152152
$total->setBaseTotalAmount('subtotal', 0);
153153
$total->setTotalAmount('tax', 0);
154154
$total->setBaseTotalAmount('tax', 0);
155+
$total->setTotalAmount('shipping', 0);
156+
$total->setBaseTotalAmount('shipping', 0);
155157
$total->setTotalAmount('discount_tax_compensation', 0);
156158
$total->setBaseTotalAmount('discount_tax_compensation', 0);
157159
$total->setTotalAmount('shipping_discount_tax_compensation', 0);
158160
$total->setBaseTotalAmount('shipping_discount_tax_compensation', 0);
159161
$total->setSubtotalInclTax(0);
160162
$total->setBaseSubtotalInclTax(0);
163+
$total->setShippingInclTax(0);
164+
$total->setBaseShippingInclTax(0);
165+
$total->setShippingTaxAmount(0);
166+
$total->setBaseShippingTaxAmount(0);
167+
$total->setShippingAmountForDiscount(0);
168+
$total->setBaseShippingAmountForDiscount(0);
169+
$total->setBaseShippingAmountForDiscount(0);
170+
$total->setTotalAmount('extra_tax', 0);
171+
$total->setBaseTotalAmount('extra_tax', 0);
161172
}
162173

163174
/**

app/design/frontend/Magento/blank/web/css/source/components/_modals_extend.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
}
6565

6666
.modal-popup {
67+
pointer-events: none;
68+
6769
.modal-title {
6870
.lib-css(border-bottom, @modal-title__border);
6971
.lib-css(font-weight, @font-weight__light);

app/design/frontend/Magento/luma/web/css/source/components/_modals_extend.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
}
6565

6666
.modal-popup {
67+
pointer-events: none;
68+
6769
.modal-title {
6870
.lib-css(border-bottom, @modal-title__border);
6971
.lib-css(font-weight, @font-weight__light);
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Sales\Model\Order;
9+
10+
class ItemRepositoryTest extends \PHPUnit\Framework\TestCase
11+
{
12+
/** @var \Magento\Sales\Model\Order */
13+
private $order;
14+
15+
/** @var \Magento\Sales\Api\OrderItemRepositoryInterface */
16+
private $orderItemRepository;
17+
18+
/** @var \Magento\Framework\Api\SearchCriteriaBuilder */
19+
private $searchCriteriaBuilder;
20+
21+
protected function setUp()
22+
{
23+
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
24+
25+
$this->order = $objectManager->create(\Magento\Sales\Model\Order::class);
26+
$this->orderItemRepository = $objectManager->create(\Magento\Sales\Api\OrderItemRepositoryInterface::class);
27+
$this->searchCriteriaBuilder = $objectManager->create(\Magento\Framework\Api\SearchCriteriaBuilder::class);
28+
}
29+
30+
/**
31+
* @magentoDataFixture Magento/Sales/_files/order_configurable_product.php
32+
*/
33+
public function testAddOrderItemParent()
34+
{
35+
$this->order->load('100000001', 'increment_id');
36+
37+
foreach ($this->order->getItems() as $item) {
38+
if ($item->getProductType() === \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) {
39+
$orderItem = $this->orderItemRepository->get($item->getItemId());
40+
$this->assertInstanceOf(\Magento\Sales\Api\Data\OrderItemInterface::class, $orderItem->getParentItem());
41+
}
42+
}
43+
44+
$itemList = $this->orderItemRepository->getList(
45+
$this->searchCriteriaBuilder->addFilter('order_id', $this->order->getId())->create()
46+
);
47+
48+
foreach ($itemList->getItems() as $item) {
49+
if ($item->getProductType() === \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) {
50+
$this->assertInstanceOf(\Magento\Sales\Api\Data\OrderItemInterface::class, $item->getParentItem());
51+
}
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)