Skip to content

Commit 1e4fc95

Browse files
authored
Merge pull request #168 from magento-commerce/1.1.52-release
1.1.52 Release
2 parents 440257c + 3d7f4e1 commit 1e4fc95

16 files changed

+3280
-4
lines changed

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

patches/commerce/ACSD-59366_1.3.5.patch

Lines changed: 404 additions & 0 deletions
Large diffs are not rendered by default.

patches/commerce/ACSD-59952_1.3.5-p4.patch

Lines changed: 519 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Address/AbstractFilterGenerator.php b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Address/AbstractFilterGenerator.php
2+
index 80dd7eca427..35bf43f6a16 100644
3+
--- a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Address/AbstractFilterGenerator.php
4+
+++ b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Address/AbstractFilterGenerator.php
5+
@@ -6,6 +6,8 @@
6+
namespace Magento\AdvancedSalesRule\Model\Rule\Condition\FilterTextGenerator\Address;
7+
8+
use Magento\AdvancedRule\Model\Condition\FilterTextGeneratorInterface;
9+
+use Magento\Quote\Model\Quote\Address;
10+
+use Magento\Framework\DataObject;
11+
12+
abstract class AbstractFilterGenerator implements FilterTextGeneratorInterface
13+
{
14+
@@ -23,14 +25,16 @@ abstract class AbstractFilterGenerator implements FilterTextGeneratorInterface
15+
}
16+
17+
/**
18+
- * @param \Magento\Framework\DataObject $quoteAddress
19+
+ * Generate filter text for the given address
20+
+ *
21+
+ * @param DataObject $quoteAddress
22+
* @return string[]
23+
*/
24+
- public function generateFilterText(\Magento\Framework\DataObject $quoteAddress)
25+
+ public function generateFilterText(DataObject $quoteAddress)
26+
{
27+
$filterText = [];
28+
- if ($quoteAddress instanceof \Magento\Quote\Model\Quote\Address) {
29+
- $value = $quoteAddress->getData($this->attribute);
30+
+ if ($quoteAddress instanceof Address) {
31+
+ $value = $quoteAddress->getData($this->attribute) ?? $quoteAddress->getQuote()->getPayment()->getMethod();
32+
if (is_scalar($value)) {
33+
$filterText[] = $this->getFilterTextPrefix() . $this->attribute . ':' . $value;
34+
}
35+
@@ -39,6 +43,8 @@ abstract class AbstractFilterGenerator implements FilterTextGeneratorInterface
36+
}
37+
38+
/**
39+
+ * Abstract function
40+
+ *
41+
* @return string
42+
*/
43+
abstract protected function getFilterTextPrefix();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
diff --git a/vendor/magento/module-google-tag-manager/view/frontend/layout/default.xml b/vendor/magento/module-google-tag-manager/view/frontend/layout/default.xml
2+
index eaeecc0c11d7..c3b13c44e7b4 100644
3+
--- a/vendor/magento/module-google-tag-manager/view/frontend/layout/default.xml
4+
+++ b/vendor/magento/module-google-tag-manager/view/frontend/layout/default.xml
5+
@@ -11,6 +11,11 @@
6+
<referenceBlock name="google_analytics" remove="true" />
7+
<referenceBlock name="google_gtag_analytics" remove="true" />
8+
<referenceContainer name="head.additional">
9+
+ <block class="Magento\Framework\View\Element\Template" name="nonce_variable" as="nonce_variable" template="Magento_Csp::nonce/nonce.phtml">
10+
+ <arguments>
11+
+ <argument name="nonce_provider" xsi:type="object">Magento\Csp\ViewModel\NonceProvider</argument>
12+
+ </arguments>
13+
+ </block>
14+
<block class="Magento\GoogleTagManager\Block\Ga" name="google_analyticsuniversal" as="google_analyticsuniversal"
15+
template="Magento_GoogleTagManager::ga.phtml" />
16+
<block class="Magento\GoogleTagManager\Block\GtagGa"
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
diff --git a/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/CategoryPlugin.php b/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/CategoryPlugin.php
2+
new file mode 100644
3+
index 00000000000..af1ccf507d7
4+
--- /dev/null
5+
+++ b/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/CategoryPlugin.php
6+
@@ -0,0 +1,75 @@
7+
+<?php
8+
+/**
9+
+ * ADOBE CONFIDENTIAL
10+
+ *
11+
+ * Copyright 2023 Adobe
12+
+ * All Rights Reserved.
13+
+ *
14+
+ * NOTICE: All information contained herein is, and remains
15+
+ * the property of Adobe and its suppliers, if any. The intellectual
16+
+ * and technical concepts contained herein are proprietary to Adobe
17+
+ * and its suppliers and are protected by all applicable intellectual
18+
+ * property laws, including trade secret and copyright laws.
19+
+ * Dissemination of this information or reproduction of this material
20+
+ * is strictly forbidden unless prior written permission is obtained
21+
+ * from Adobe.
22+
+ */
23+
+declare(strict_types=1);
24+
+
25+
+namespace Magento\CatalogPermissions\Plugin\Sitemap\Model\ResourceModel\Catalog;
26+
+
27+
+use Magento\CatalogPermissions\App\Config;
28+
+use Magento\CatalogPermissions\Model\Permission\Index;
29+
+use Magento\Customer\Model\Group;
30+
+use Magento\Framework\DB\Select;
31+
+use Magento\Sitemap\Model\ResourceModel\Catalog\CategorySelectBuilder;
32+
+use Magento\Store\Api\Data\StoreInterface;
33+
+
34+
+class CategoryPlugin
35+
+{
36+
+
37+
+ /**
38+
+ * @param Config $config
39+
+ * @param Index $permissionIndex
40+
+ */
41+
+ public function __construct(
42+
+ private readonly Config $config,
43+
+ private readonly Index $permissionIndex
44+
+ ) {
45+
+ }
46+
+
47+
+ /**
48+
+ * Allow only products from public shared catalog assigned to allowed categories
49+
+ *
50+
+ * @param CategorySelectBuilder $subject
51+
+ * @param Select $select
52+
+ * @param string $mainTableName
53+
+ * @param string $idField
54+
+ * @param StoreInterface $store
55+
+ * @param string $path
56+
+ * @return Select
57+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
58+
+ */
59+
+ public function afterExecute(
60+
+ CategorySelectBuilder $subject,
61+
+ Select $select,
62+
+ string $mainTableName,
63+
+ string $idField,
64+
+ StoreInterface $store,
65+
+ string $path
66+
+ ): Select {
67+
+ if (!$this->config->isEnabled($store->getId())) {
68+
+ return $select;
69+
+ }
70+
+
71+
+ $restrictedCategoryIds = $this->permissionIndex->getRestrictedCategoryIds(
72+
+ Group::NOT_LOGGED_IN_ID,
73+
+ $store->getWebsiteId()
74+
+ );
75+
+ if (count($restrictedCategoryIds)) {
76+
+ $select->where('e.entity_id NOT IN (?)', $restrictedCategoryIds);
77+
+ }
78+
+
79+
+ return $select;
80+
+ }
81+
+}
82+
diff --git a/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/ProductPlugin.php b/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/ProductPlugin.php
83+
new file mode 100644
84+
index 00000000000..f1df4e384ee
85+
--- /dev/null
86+
+++ b/vendor/magento/module-catalog-permissions/Plugin/Sitemap/Model/ResourceModel/Catalog/ProductPlugin.php
87+
@@ -0,0 +1,92 @@
88+
+<?php
89+
+/**
90+
+ * ADOBE CONFIDENTIAL
91+
+ *
92+
+ * Copyright 2023 Adobe
93+
+ * All Rights Reserved.
94+
+ *
95+
+ * NOTICE: All information contained herein is, and remains
96+
+ * the property of Adobe and its suppliers, if any. The intellectual
97+
+ * and technical concepts contained herein are proprietary to Adobe
98+
+ * and its suppliers and are protected by all applicable intellectual
99+
+ * property laws, including trade secret and copyright laws.
100+
+ * Dissemination of this information or reproduction of this material
101+
+ * is strictly forbidden unless prior written permission is obtained
102+
+ * from Adobe.
103+
+ */
104+
+declare(strict_types=1);
105+
+
106+
+namespace Magento\CatalogPermissions\Plugin\Sitemap\Model\ResourceModel\Catalog;
107+
+
108+
+use Magento\CatalogPermissions\App\Config;
109+
+use Magento\CatalogPermissions\Model\Permission;
110+
+use Magento\CatalogPermissions\Model\Permission\Index;
111+
+use Magento\Customer\Model\Group;
112+
+use Magento\Framework\DB\Select;
113+
+use Magento\Sitemap\Model\ResourceModel\Catalog\ProductSelectBuilder;
114+
+use Magento\Store\Api\Data\StoreInterface;
115+
+
116+
+class ProductPlugin
117+
+{
118+
+ /**
119+
+ * @param Config $config
120+
+ * @param Index $permissionIndex
121+
+ */
122+
+ public function __construct(
123+
+ private Config $config,
124+
+ private readonly Index $permissionIndex
125+
+ ) {
126+
+ }
127+
+
128+
+ /**
129+
+ * Allow only products from public shared catalog assigned to allowed categories
130+
+ *
131+
+ * @param ProductSelectBuilder $subject
132+
+ * @param Select $select
133+
+ * @param string $mainTableName
134+
+ * @param string $idField
135+
+ * @param string $linkField
136+
+ * @param StoreInterface $store
137+
+ * @return Select
138+
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
139+
+ */
140+
+ public function afterExecute(
141+
+ ProductSelectBuilder $subject,
142+
+ Select $select,
143+
+ string $mainTableName,
144+
+ string $idField,
145+
+ string $linkField,
146+
+ StoreInterface $store
147+
+ ): Select {
148+
+ if (!$this->config->isEnabled($store->getId())) {
149+
+ return $select;
150+
+ }
151+
+
152+
+ $restrictedCategoryIds = $this->permissionIndex->getRestrictedCategoryIds(
153+
+ Group::NOT_LOGGED_IN_ID,
154+
+ $store->getWebsiteId()
155+
+ );
156+
+ if (count($restrictedCategoryIds)) {
157+
+ $select->joinLeft(
158+
+ ['cp' => $select->getConnection()->getTableName('catalog_category_product')],
159+
+ 'cp.product_id = e.entity_id',
160+
+ []
161+
+ )->where(
162+
+ 'cp.category_id NOT IN (?)',
163+
+ $restrictedCategoryIds
164+
+ );
165+
+ $select->joinLeft(
166+
+ ['perm' => $select->getConnection()->getTableName('magento_catalogpermissions_index_product')],
167+
+ 'perm.product_id = e.entity_id',
168+
+ []
169+
+ )->where(
170+
+ '((perm.grant_catalog_category_view != ' . Permission::PERMISSION_DENY . '
171+
+ AND perm.customer_group_id = ' . Group::NOT_LOGGED_IN_ID . '
172+
+ AND perm.store_id in (?)) OR perm.grant_catalog_category_view IS NULL)',
173+
+ [$store->getId()]
174+
+ );
175+
+ }
176+
+
177+
+ return $select;
178+
+ }
179+
+}
180+
diff --git a/vendor/magento/module-catalog-permissions/etc/di.xml b/vendor/magento/module-catalog-permissions/etc/di.xml
181+
index f1a96cd977f..390b89b3380 100644
182+
--- a/vendor/magento/module-catalog-permissions/etc/di.xml
183+
+++ b/vendor/magento/module-catalog-permissions/etc/di.xml
184+
@@ -99,4 +99,12 @@
185+
<plugin name="check_catalog_permission_after_get_section_data"
186+
type="Magento\CatalogPermissions\Plugin\Sales\CustomerData\CheckCatalogPermissionAfterLastOrderedItemsPlugin" />
187+
</type>
188+
+ <type name="Magento\Sitemap\Model\ResourceModel\Catalog\ProductSelectBuilder">
189+
+ <plugin name="generate_sitemap_with_allowed_products_permissions"
190+
+ type="Magento\CatalogPermissions\Plugin\Sitemap\Model\ResourceModel\Catalog\ProductPlugin" />
191+
+ </type>
192+
+ <type name="Magento\Sitemap\Model\ResourceModel\Catalog\CategorySelectBuilder">
193+
+ <plugin name="generate_sitemap_with_allowed_categories_permissions"
194+
+ type="Magento\CatalogPermissions\Plugin\Sitemap\Model\ResourceModel\Catalog\CategoryPlugin" />
195+
+ </type>
196+
</config>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/vendor/magento/module-sales-rule/Model/Quote/Discount.php b/vendor/magento/module-sales-rule/Model/Quote/Discount.php
2+
index 19e9bdf377bf..fcefae81780e 100644
3+
--- a/vendor/magento/module-sales-rule/Model/Quote/Discount.php
4+
+++ b/vendor/magento/module-sales-rule/Model/Quote/Discount.php
5+
@@ -188,6 +188,21 @@ public function collect(
6+
if ($item->getNoDiscount() || !$this->calculator->canApplyDiscount($item) || $item->getParentItem()) {
7+
continue;
8+
}
9+
+
10+
+ switch ($rule->getSimpleAction()) {
11+
+ case Rule::BY_PERCENT_ACTION:
12+
+ case Rule::BY_FIXED_ACTION:
13+
+ if ($rule->getDiscountStep() > $item->getQty()) {
14+
+ continue 2;
15+
+ }
16+
+ break;
17+
+ case Rule::BUY_X_GET_Y_ACTION:
18+
+ if ($rule->getDiscountStep() >= $item->getQty()) {
19+
+ continue 2;
20+
+ }
21+
+ break;
22+
+ }
23+
+
24+
$eventArgs['item'] = $item;
25+
$this->eventManager->dispatch('sales_quote_address_discount_item', $eventArgs);
26+
$this->calculator->process($item, $rule);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php b/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php
2+
index ed2e09249e495..9005cbe4249bb 100644
3+
--- a/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php
4+
+++ b/vendor/magento/module-catalog/Model/Product/Gallery/ReadHandler.php
5+
@@ -64,7 +64,7 @@ public function execute($entity, $arguments = [])
6+
7+
$this->addMediaDataToProduct(
8+
$entity,
9+
- $this->sortMediaEntriesByPosition($mediaEntries)
10+
+ $mediaEntries
11+
);
12+
13+
return $entity;
14+
@@ -80,6 +80,7 @@ public function execute($entity, $arguments = [])
15+
*/
16+
public function addMediaDataToProduct(Product $product, array $mediaEntries)
17+
{
18+
+ $mediaEntries = $this->sortMediaEntriesByPosition($mediaEntries);
19+
$product->setData(
20+
$this->getAttribute()->getAttributeCode(),
21+
[
22+
@@ -111,6 +112,7 @@ public function getAttribute()
23+
* @param string[] $image
24+
* @return string
25+
* @deprecated 101.0.1
26+
+ * @see \Magento\Catalog\Model\Product\Gallery\ReadHandler::addMediaDataToProduct
27+
* @since 101.0.0
28+
*/
29+
protected function findDefaultValue($key, &$image)

0 commit comments

Comments
 (0)