Skip to content

Commit 4da2e69

Browse files
Merge pull request #212 from magento-commerce/1.1.71-release
1.1.71 Release
2 parents 57e7d6e + d1574e3 commit 4da2e69

14 files changed

+3050
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
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.70",
5+
"version": "1.1.71",
66
"license": "proprietary",
77
"repositories": {
88
"repo": {

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
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 000000000000..af1ccf507d7a
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 000000000000..f1df4e384eeb
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 f1a96cd977fa..390b89b33806 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>
197+

patches/os/ACSD-60624_2.2.5.patch

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
diff --git a/vendor/magento/module-page-builder/view/adminhtml/requirejs-config.js b/vendor/magento/module-page-builder/view/adminhtml/requirejs-config.js
2+
index f7a5d86cf..b764530aa 100644
3+
--- a/vendor/magento/module-page-builder/view/adminhtml/requirejs-config.js
4+
+++ b/vendor/magento/module-page-builder/view/adminhtml/requirejs-config.js
5+
@@ -41,6 +41,9 @@ var config = {
6+
},
7+
'Magento_PageBuilder/js/content-type/row/appearance/default/widget': {
8+
'Magento_PageBuilder/js/content-type/row/appearance/default/widget-mixin': true
9+
+ },
10+
+ 'Magento_Ui/js/form/element/file-uploader': {
11+
+ 'Magento_PageBuilder/js/form/element/file-uploader': true
12+
}
13+
}
14+
}
15+
diff --git a/vendor/magento/module-page-builder/view/adminhtml/web/js/form/element/file-uploader.js b/vendor/magento/module-page-builder/view/adminhtml/web/js/form/element/file-uploader.js
16+
new file mode 100644
17+
index 000000000..aac437c59
18+
--- /dev/null
19+
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/js/form/element/file-uploader.js
20+
@@ -0,0 +1,36 @@
21+
+/**
22+
+ * Copyright 2024 Adobe
23+
+ * All Rights Reserved.
24+
+ */
25+
+
26+
+define([
27+
+ 'jquery'
28+
+], function ($) {
29+
+ 'use strict';
30+
+
31+
+ return function (Element) {
32+
+ return Element.extend({
33+
+
34+
+ /**
35+
+ * {@inheritDoc}
36+
+ */
37+
+ replaceInputTypeFile: function (fileInput) {
38+
+ let fileId = fileInput.id, fileName = fileInput.name, fileClass = fileInput.className,
39+
+ spanElement = '<span id=\'' + fileId + fileClass + '\' ></span>';
40+
+
41+
+ $('#' + fileId).closest('.file-uploader-area').attr('upload-area-id', fileName);
42+
+ $('#' + fileId + fileClass).closest('.file-uploader-area').attr('upload-area-id', fileName);
43+
+
44+
+ $(fileInput).replaceWith(spanElement);
45+
+
46+
+ $('#' + fileId).closest('.file-uploader-area').find('.file-uploader-button:first').on('click', function () {
47+
+ $(this).closest('.file-uploader-area').find('.uppy-Dashboard-browse').trigger('click');
48+
+ });
49+
+
50+
+ $('#' + fileId + fileClass).closest('.file-uploader-area').find('.action-upload-image').on('click', function () {
51+
+ $(this).closest('.file-uploader-area').find('.uppy-Dashboard-browse').trigger('click');
52+
+ });
53+
+ },
54+
+ });
55+
+ };
56+
+});
57+
diff --git a/vendor/magento/module-page-builder/view/adminhtml/web/template/form/element/uploader/preview/image.html b/vendor/magento/module-page-builder/view/adminhtml/web/template/form/element/uploader/preview/image.html
58+
index 8a57ee602..4b95d804b 100644
59+
--- a/vendor/magento/module-page-builder/view/adminhtml/web/template/form/element/uploader/preview/image.html
60+
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/template/form/element/uploader/preview/image.html
61+
@@ -9,12 +9,20 @@
62+
<div class="pagebuilder-options-wrapper">
63+
<ul class="pagebuilder-options-links">
64+
<li class="pagebuilder-options-link">
65+
- <label
66+
- data-bind="event: {mousedown: stopEvent}"
67+
- class="file-uploader-button action-default"
68+
- attr="for: uid"
69+
- disable="disabled"
70+
- translate="translations.uploadNewImage"></label>
71+
+ <span class="file-uploader-area" if="visibleControls">
72+
+ <input
73+
+ type="file"
74+
+ afterRender="onElementRender"
75+
+ attr="id: uid, name: inputName, multiple: isMultipleFiles"
76+
+ class="file-upload-options-link"
77+
+ disable="disabled"></input>
78+
+ <label
79+
+ data-bind="event: {mousedown: stopEvent}"
80+
+ class="file-uploader-button action-default action-upload-image"
81+
+ attr="for: uid"
82+
+ disable="disabled"
83+
+ translate="translations.uploadNewImage"></label>
84+
+ </span>
85+
</li>
86+
<li class="pagebuilder-options-link">
87+
<label
88+
@@ -38,8 +46,17 @@
89+
<div class="file-uploader image-uploader">
90+
<div class="file-uploader-area" if="visibleControls">
91+
<p class="image-upload-instructions" translate="translations.dragImageHere"></p>
92+
- <input type="file" afterRender="onElementRender" attr="id: uid, name: inputName, multiple: isMultipleFiles" disable="disabled"/>
93+
- <label class="file-uploader-button action-default" attr="for: uid" disable="disabled" translate="translations.uploadImage"></label>
94+
+ <input
95+
+ type="file"
96+
+ class="file-upload-empty-preview"
97+
+ afterRender="onElementRender"
98+
+ attr="id: uid, name: inputName, multiple: isMultipleFiles"
99+
+ disable="disabled"></input>
100+
+ <label
101+
+ class="file-uploader-button action-default action-upload-image"
102+
+ attr="for: uid"
103+
+ disable="disabled"
104+
+ translate="translations.uploadImage"></label>
105+
<span translate="translations.or"></span>
106+
<label
107+
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog}"

0 commit comments

Comments
 (0)