Skip to content

Commit 08ff905

Browse files
authored
Merge pull request #181 from magento-commerce/1.1.58-release
1.1.58 Release
2 parents b4ba968 + 6d36fc8 commit 08ff905

21 files changed

+2278
-10
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/quality-patches",
33
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
44
"type": "magento2-component",
5-
"version": "1.1.57",
5+
"version": "1.1.58",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

+1-1
Large diffs are not rendered by default.
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
diff --git a/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php b/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php
2+
index 2e230c870bef..420176d1d9fa 100644
3+
--- a/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php
4+
+++ b/vendor/magento/module-purchase-order/Plugin/Quote/Model/QuotePlugin.php
5+
@@ -1,7 +1,21 @@
6+
<?php
7+
-/**
8+
- * Copyright © Magento, Inc. All rights reserved.
9+
- * See COPYING.txt for license details.
10+
+/************************************************************************
11+
+ *
12+
+ * ADOBE CONFIDENTIAL
13+
+ * ___________________
14+
+ *
15+
+ * Copyright 2020 Adobe
16+
+ * All Rights Reserved.
17+
+ *
18+
+ * NOTICE: All information contained herein is, and remains
19+
+ * the property of Adobe and its suppliers, if any. The intellectual
20+
+ * and technical concepts contained herein are proprietary to Adobe
21+
+ * and its suppliers and are protected by all applicable intellectual
22+
+ * property laws, including trade secret and copyright laws.
23+
+ * Dissemination of this information or reproduction of this material
24+
+ * is strictly forbidden unless prior written permission is obtained
25+
+ * from Adobe.
26+
+ * ************************************************************************
27+
*/
28+
declare(strict_types=1);
29+
30+
@@ -32,7 +46,7 @@ public function __construct(
31+
}
32+
33+
/**
34+
- * Skip collect totals for purchase order
35+
+ * Skip collect totals for purchase order except while converted to an order
36+
*
37+
* @param Quote $subject
38+
* @param \Closure $proceed
39+
@@ -40,10 +54,19 @@ public function __construct(
40+
*/
41+
public function aroundCollectTotals(Quote $subject, \Closure $proceed)
42+
{
43+
- if ($this->isPurchaseOrderQuote($subject) && !$subject->getIsVirtual()) {
44+
- return $subject;
45+
+ if (!$this->isPurchaseOrderQuote($subject) || $subject->getIsVirtual()) {
46+
+ return $proceed();
47+
+ }
48+
+
49+
+ if ($subject->getIsActive() && $subject->getTotalsCollectedFlag()) {
50+
+ $items = $subject->getItems();
51+
+ if (is_array($items) && (float)$items[0]->getData('tax_amount') > 0) {
52+
+ $subject->setTotalsCollectedFlag(false);
53+
+ return $proceed();
54+
+ }
55+
}
56+
- return $proceed();
57+
+
58+
+ return $subject;
59+
}
60+
61+
/**
+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
diff --git a/vendor/magento/module-gift-registry/Block/Email/Items.php b/vendor/magento/module-gift-registry/Block/Email/Items.php
2+
index 3cbacb020bc2..c988eb5ea708 100644
3+
--- a/vendor/magento/module-gift-registry/Block/Email/Items.php
4+
+++ b/vendor/magento/module-gift-registry/Block/Email/Items.php
5+
@@ -1,8 +1,23 @@
6+
<?php
7+
-/**
8+
- * Copyright © Magento, Inc. All rights reserved.
9+
- * See COPYING.txt for license details.
10+
+/************************************************************************
11+
+ *
12+
+ * ADOBE CONFIDENTIAL
13+
+ * ___________________
14+
+ *
15+
+ * Copyright 2014 Adobe
16+
+ * All Rights Reserved.
17+
+ *
18+
+ * NOTICE: All information contained herein is, and remains
19+
+ * the property of Adobe and its suppliers, if any. The intellectual
20+
+ * and technical concepts contained herein are proprietary to Adobe
21+
+ * and its suppliers and are protected by all applicable intellectual
22+
+ * property laws, including trade secret and copyright laws.
23+
+ * Dissemination of this information or reproduction of this material
24+
+ * is strictly forbidden unless prior written permission is obtained
25+
+ * from Adobe.
26+
+ * ************************************************************************
27+
*/
28+
+
29+
namespace Magento\GiftRegistry\Block\Email;
30+
31+
use Magento\GiftRegistry\Model\ResourceModel\Item\CollectionFactory as CollectionFactory;
32+
@@ -47,7 +62,15 @@ public function getItems()
33+
if ($entity) {
34+
return $entity->getItemsCollection();
35+
}
36+
- return $this->entityCollectionFactory->create();
37+
+
38+
+ $collection = $this->entityCollectionFactory->create();
39+
+ if ($this->getEntityId()) {
40+
+ $collection->addRegistryFilter($this->getEntityId());
41+
+ } else {
42+
+ // If entity id is not set, return empty collection
43+
+ $collection->getSelect()->where('1=0');
44+
+ }
45+
+ return $collection;
46+
}
47+
48+
/**
49+
@@ -58,7 +81,7 @@ public function getItems()
50+
*/
51+
public function getQtyOrdered($item)
52+
{
53+
- $updatedQty = $this->getEntity()->getUpdatedQty();
54+
+ $updatedQty = $this->getUpdatedQty() ?? $this->getEntity()?->getUpdatedQty();
55+
if (is_array($updatedQty) && !empty($updatedQty[$item->getId()]['ordered'])) {
56+
return $updatedQty[$item->getId()]['ordered'] * 1;
57+
}
58+
@@ -100,7 +123,7 @@ public function getQty($item)
59+
*/
60+
public function getQtyFulfilled($item)
61+
{
62+
- $updatedQty = $this->getEntity()->getUpdatedQty();
63+
+ $updatedQty = $this->getUpdatedQty() ?? $this->getEntity()?->getUpdatedQty();
64+
if (is_array($updatedQty) && !empty($updatedQty[$item->getId()]['fulfilled'])) {
65+
return $updatedQty[$item->getId()]['fulfilled'] * 1;
66+
}
67+
diff --git a/vendor/magento/module-gift-registry/view/frontend/email/update.html b/vendor/magento/module-gift-registry/view/frontend/email/update.html
68+
index db41f2979f60..8da914b58baf 100644
69+
--- a/vendor/magento/module-gift-registry/view/frontend/email/update.html
70+
+++ b/vendor/magento/module-gift-registry/view/frontend/email/update.html
71+
@@ -1,7 +1,21 @@
72+
<!--
73+
-/**
74+
- * Copyright © Magento, Inc. All rights reserved.
75+
- * See COPYING.txt for license details.
76+
+/************************************************************************
77+
+ *
78+
+ * ADOBE CONFIDENTIAL
79+
+ * ___________________
80+
+ *
81+
+ * Copyright 2014 Adobe
82+
+ * All Rights Reserved.
83+
+ *
84+
+ * NOTICE: All information contained herein is, and remains
85+
+ * the property of Adobe and its suppliers, if any. The intellectual
86+
+ * and technical concepts contained herein are proprietary to Adobe
87+
+ * and its suppliers and are protected by all applicable intellectual
88+
+ * property laws, including trade secret and copyright laws.
89+
+ * Dissemination of this information or reproduction of this material
90+
+ * is strictly forbidden unless prior written permission is obtained
91+
+ * from Adobe.
92+
+ * ************************************************************************
93+
*/
94+
-->
95+
<!--@subject {{trans "Gift Registry updated at %store_name" store_name=$store.frontend_name}} @-->
96+
@@ -15,6 +29,8 @@
97+
"layout handle=\"magento_giftregistry_email_entity_items\" entity=$entity":"Registry Items",
98+
"var entity.title|escape":"Registry Title",
99+
"var store.frontend_name":"Store Name",
100+
+"var entity.entity_id":"Gift Registry ID",
101+
+"var entity.updated_qty":"List of Gift Registry items with updated quantities",
102+
"store url=\"\"":"Store URL",
103+
"var entity":"Entity"
104+
} @-->
105+
@@ -25,7 +41,7 @@
106+
107+
<p>{{trans "The following items have been purchased from your gift registry \"%registry_name\":" registry_name=$entity.title}}</p>
108+
109+
-{{layout handle="magento_giftregistry_email_entity_items" entity=$entity}}
110+
+{{layout handle="magento_giftregistry_email_entity_items" entity_id=$entity.entity_id updated_qty=$entity.updated_qty}}
111+
112+
<p>{{trans "You can sign in to your account to view more details about this gift registry."}}</p>
113+
+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
diff --git a/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php b/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php
2+
index 06f702316482..6fe209f6fac8 100644
3+
--- a/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php
4+
+++ b/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php
5+
@@ -1,11 +1,24 @@
6+
<?php
7+
-/**
8+
- * Copyright © Magento, Inc. All rights reserved.
9+
- * See COPYING.txt for license details.
10+
+/************************************************************************
11+
+ *
12+
+ * ADOBE CONFIDENTIAL
13+
+ * ___________________
14+
+ *
15+
+ * Copyright 2014 Adobe
16+
+ * All Rights Reserved.
17+
+ *
18+
+ * NOTICE: All information contained herein is, and remains
19+
+ * the property of Adobe and its suppliers, if any. The intellectual
20+
+ * and technical concepts contained herein are proprietary to Adobe
21+
+ * and its suppliers and are protected by all applicable intellectual
22+
+ * property laws, including trade secret and copyright laws.
23+
+ * Dissemination of this information or reproduction of this material
24+
+ * is strictly forbidden unless prior written permission is obtained
25+
+ * from Adobe.
26+
+ * ************************************************************************
27+
*/
28+
+
29+
namespace Magento\AdvancedCheckout\Block\Adminhtml\Sku;
30+
-use Magento\Framework\App\ObjectManager;
31+
-use Magento\Framework\View\Helper\SecureHtmlRenderer;
32+
33+
/**
34+
* Admin Checkout main form container
35+
@@ -22,7 +35,7 @@ abstract class AbstractSku extends \Magento\Backend\Block\Template
36+
/**
37+
* List type of current block
38+
*/
39+
- const LIST_TYPE = 'add_by_sku';
40+
+ public const LIST_TYPE = 'add_by_sku';
41+
42+
/**
43+
* @var string
44+
@@ -34,27 +47,19 @@ abstract class AbstractSku extends \Magento\Backend\Block\Template
45+
*/
46+
protected $_jsonEncoder;
47+
48+
- /**
49+
- * @var SecureHtmlRenderer
50+
- */
51+
- private $secureRenderer;
52+
-
53+
/**
54+
* @codeCoverageIgnore
55+
* @param \Magento\Backend\Block\Template\Context $context
56+
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
57+
* @param array $data
58+
- * @param SecureHtmlRenderer|null $secureRenderer
59+
* @codeCoverageIgnore
60+
*/
61+
public function __construct(
62+
\Magento\Backend\Block\Template\Context $context,
63+
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
64+
- array $data = [],
65+
- SecureHtmlRenderer $secureRenderer = null
66+
+ array $data = []
67+
) {
68+
$this->_jsonEncoder = $jsonEncoder;
69+
- $this->secureRenderer = $secureRenderer ?? ObjectManager::getInstance()->get(SecureHtmlRenderer::class);
70+
parent::__construct($context, $data);
71+
}
72+
73+
@@ -79,33 +84,10 @@ protected function _construct()
74+
*/
75+
protected function _prepareLayout()
76+
{
77+
- //Delete button will be copied for each row so we need a listener that will work for duplicates.
78+
- $deleteButtonId = $this->mathRandom->getRandomString('8');
79+
- $deleteButtonClass = 'admin-checkout-sku-delete-button-' . $deleteButtonId;
80+
- $deleteFunctionName = 'skuDeleteButtonListener' . $deleteButtonId;
81+
- $deleteActionScript = <<<SCRIPT
82+
- if (typeof($deleteFunctionName) == "undefined") {
83+
- $deleteFunctionName = function (event) {
84+
- addBySku.del(event.target);
85+
- };
86+
- require(['jquery'], function($){
87+
- $("body").on("click", ".$deleteButtonClass", $deleteFunctionName);
88+
- });
89+
- }
90+
-SCRIPT;
91+
$this->addChild(
92+
'deleteButton',
93+
\Magento\Backend\Block\Widget\Button::class,
94+
- [
95+
- 'label' => '',
96+
- 'class' => 'action-delete ' . $deleteButtonClass,
97+
- 'before_html' => $this->secureRenderer->renderTag(
98+
- 'script',
99+
- ['type' => 'text/javascript'],
100+
- $deleteActionScript,
101+
- false
102+
- ),
103+
- ]
104+
+ ['label' => '', 'class' => 'action-delete']
105+
);
106+
107+
$this->addChild(
108+
diff --git a/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml b/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml
109+
index c84b601f5df9..b85a7f5254b6 100644
110+
--- a/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml
111+
+++ b/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml
112+
@@ -1,12 +1,28 @@
113+
<?php
114+
-/**
115+
- * Copyright © Magento, Inc. All rights reserved.
116+
- * See COPYING.txt for license details.
117+
+/************************************************************************
118+
+ *
119+
+ * ADOBE CONFIDENTIAL
120+
+ * ___________________
121+
+ *
122+
+ * Copyright 2014 Adobe
123+
+ * All Rights Reserved.
124+
+ *
125+
+ * NOTICE: All information contained herein is, and remains
126+
+ * the property of Adobe and its suppliers, if any. The intellectual
127+
+ * and technical concepts contained herein are proprietary to Adobe
128+
+ * and its suppliers and are protected by all applicable intellectual
129+
+ * property laws, including trade secret and copyright laws.
130+
+ * Dissemination of this information or reproduction of this material
131+
+ * is strictly forbidden unless prior written permission is obtained
132+
+ * from Adobe.
133+
+ * ************************************************************************
134+
*/
135+
// phpcs:disable Generic.Files.LineLength
136+
137+
/**
138+
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
139+
+ * @var \Magento\Framework\Escaper $escaper
140+
+ * @var \Magento\AdvancedCheckout\Block\Adminhtml\Sku\AbstractSku $block
141+
*/
142+
?>
143+
<div class="add-by-sku-wrapper">
144+
@@ -18,8 +34,8 @@
145+
class="admin__control-table">
146+
<thead>
147+
<tr class="headings">
148+
- <th class="col-sku"><?= $block->escapeHtml(__('SKU number')) ?></th>
149+
- <th class="col-qty"><?= $block->escapeHtml(__('Qty')) ?></th>
150+
+ <th class="col-sku"><?= $escaper->escapeHtml(__('SKU number')) ?></th>
151+
+ <th class="col-qty"><?= $escaper->escapeHtml(__('Qty')) ?></th>
152+
<th class="col-actions last">&nbsp;</th>
153+
</tr>
154+
</thead>
155+
@@ -51,10 +67,10 @@
156+
</div>
157+
</div>
158+
<div class="admin__field add-sku-csv">
159+
- <label class="admin__field-label" for="sku_upload"><?= $block->escapeHtml(__('Upload File')) ?></label>
160+
+ <label class="admin__field-label" for="sku_upload"><?= $escaper->escapeHtml(__('Upload File')) ?></label>
161+
<div class="admin__field-control">
162+
<div class="admin__field-note">
163+
- <span><?= $block->escapeHtml(__('Your csv file must include "sku" and "qty" columns.')) ?></span>
164+
+ <span><?= $escaper->escapeHtml(__('Your csv file must include "sku" and "qty" columns.')) ?></span>
165+
</div>
166+
<?php $inputName = \Magento\AdvancedCheckout\Model\Import::FIELD_NAME_SOURCE_FILE; ?>
167+
<input
168+
@@ -65,7 +81,7 @@
169+
value="" />
170+
<button type="button"
171+
class="action-default action-reset">
172+
- <span><?= $block->escapeHtml(__('Reset')) ?></span>
173+
+ <span><?= $escaper->escapeHtml(__('Reset')) ?></span>
174+
</button>
175+
</div>
176+
<?= /* @noEscape */
177+
@@ -79,7 +95,7 @@
178+
</div>
179+
180+
<?php
181+
-$adminCheckoutInstanceName = $block->escapeJs($block->getJsOrderObject());
182+
+$adminCheckoutInstanceName = $escaper->escapeJs($block->getJsOrderObject());
183+
$addBySkuData = $block->getAddBySkuDataJson();
184+
$additionalJavaScript = $block->getAdditionalJavascript();
185+
$contextSpecificJs = $block->getContextSpecificJs();
186+
@@ -115,7 +131,7 @@ require([
187+
}
188+
189+
window.initSku = initSku;
190+
- $('sku_table').on('click', "[data-ui-id='sku-accordion-deletebutton']", function(event) {
191+
+ jQuery('#sku_table').on('click', '.action-delete', function(event) {
192+
addBySku.del(event.target);
193+
});
194+
195+

0 commit comments

Comments
 (0)