Skip to content

Commit

Permalink
Merge pull request #164 from magento-commerce/1.1.50-release
Browse files Browse the repository at this point in the history
1.1.50 Release
  • Loading branch information
katmoon authored Aug 28, 2024
2 parents e8ad819 + 7884753 commit d2e5320
Show file tree
Hide file tree
Showing 33 changed files with 6,661 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/quality-patches",
"description": "Provides quality patches for AdobeCommerce & Magento OpenSource",
"type": "magento2-component",
"version": "1.1.49",
"version": "1.1.50",
"license": "proprietary",
"repositories": {
"repo": {
Expand Down
2 changes: 1 addition & 1 deletion patches-info.json

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions patches/commerce/ACSD-58352_2.4.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/vendor/magento/module-rma-graph-ql/Model/Formatter/CustomAttribute.php b/vendor/magento/module-rma-graph-ql/Model/Formatter/CustomAttribute.php
index a38f91377171..2f7864714c17 100644
--- a/vendor/magento/module-rma-graph-ql/Model/Formatter/CustomAttribute.php
+++ b/vendor/magento/module-rma-graph-ql/Model/Formatter/CustomAttribute.php
@@ -33,19 +33,27 @@ class CustomAttribute
*/
private $optionValueProvider;

+ /**
+ * @var \Magento\Store\Model\StoreManagerInterface
+ */
+ private $storeManager;
+
/**
* @param SerializerInterface $serializer
* @param Uid $idEncoder
* @param OptionValueProvider $optionValueProvider
+ * @param \Magento\Store\Model\StoreManagerInterface $storeManager
*/
public function __construct(
SerializerInterface $serializer,
Uid $idEncoder,
- OptionValueProvider $optionValueProvider
+ OptionValueProvider $optionValueProvider,
+ \Magento\Store\Model\StoreManagerInterface $storeManager
) {
$this->serializer = $serializer;
$this->idEncoder = $idEncoder;
$this->optionValueProvider = $optionValueProvider;
+ $this->storeManager = $storeManager;
}

/**
@@ -63,8 +71,27 @@ public function format(AttributeInterface $attribute, $value): array

return [
'uid' => $this->idEncoder->encode((string)$attribute->getAttributeId()),
- 'label' => $attribute->getDefaultFrontendLabel(),
+ 'label' => $this->getFrontendLabels($attribute),
'value' => $this->serializer->serialize($value)
];
}
+
+ /**
+ * Get frontend labels according to store
+ *
+ * @param AttributeInterface $attribute
+ * @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function getFrontendLabels(AttributeInterface $attribute) : string
+ {
+ $storeId = $this->storeManager->getStore()->getId();
+
+ $frontendLabels = [];
+ foreach ($attribute->getFrontendLabels() as $label) {
+ $frontendLabels[$label->getStoreId()] = $label->getLabel();
+ }
+
+ return $frontendLabels[$storeId] ?? $attribute->getDefaultFrontendLabel();
+ }
}
17 changes: 17 additions & 0 deletions patches/commerce/ACSD-58442_2.2.4-p3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/vendor/magento/module-page-builder/etc/view.xml b/vendor/magento/module-page-builder/etc/view.xml
index 4e4052bcb..684423384 100644
--- a/vendor/magento/module-page-builder/etc/view.xml
+++ b/vendor/magento/module-page-builder/etc/view.xml
@@ -62,9 +62,9 @@
<var name="stage">true</var>
<var name="class">mobile-switcher</var>
<var name="icon">Magento_PageBuilder::css/images/switcher/switcher-mobile.svg</var>
- <var name="media">only screen and (max-width: 768px)</var>
+ <var name="media">only screen and (max-width: 767px)</var>
<var name="conditions">
- <var name="max-width">768px</var>
+ <var name="max-width">767px</var>
<var name="min-width">640px</var>
</var>
<var name="options">

43 changes: 43 additions & 0 deletions patches/commerce/ACSD-59414_2.4.6-p5_v2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/vendor/magento/module-catalog-rule-staging/Model/CatalogRuleApplier.php b/vendor/magento/module-catalog-rule-staging/Model/CatalogRuleApplier.php
index e62cd775e8b..8ee4258caa1 100644
--- a/vendor/magento/module-catalog-rule-staging/Model/CatalogRuleApplier.php
+++ b/vendor/magento/module-catalog-rule-staging/Model/CatalogRuleApplier.php
@@ -9,10 +9,8 @@ use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor;
use Magento\Staging\Model\StagingApplierInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Indexer\IndexerRegistry;
+use Magento\Catalog\Model\Indexer\Product\Price\Processor as PriceProcessor;

-/**
- * Class CatalogRuleApplier
- */
class CatalogRuleApplier implements StagingApplierInterface
{
/**
@@ -36,11 +34,12 @@ class CatalogRuleApplier implements StagingApplierInterface
IndexerRegistry $indexerRegistry = null
) {
$this->ruleProductProcessor = $ruleProductProcessor;
- $this->indexerRegistry = $indexerRegistry
- ?: ObjectManager::getInstance()->get(IndexerRegistry::class);
+ $this->indexerRegistry = $indexerRegistry ?: ObjectManager::getInstance()->get(IndexerRegistry::class);
}

/**
+ * Invalidate related indexers
+ *
* @param array $entityIds
* @return void
*/
@@ -48,10 +47,7 @@ class CatalogRuleApplier implements StagingApplierInterface
{
if (!empty($entityIds)) {
$this->ruleProductProcessor->markIndexerAsInvalid();
- $this->indexerRegistry->get(\Magento\CatalogRule\Model\Indexer\Product\ProductRuleProcessor::INDEXER_ID)
- ->invalidate();
- $this->indexerRegistry->get(\Magento\Catalog\Model\Indexer\Product\Price\Processor::INDEXER_ID)
- ->invalidate();
+ $this->indexerRegistry->get(PriceProcessor::INDEXER_ID)->invalidate();
}
}
}
130 changes: 130 additions & 0 deletions patches/commerce/ACSD-59514_2.2.2-p7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
diff --git a/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
new file mode 100644
index 0000000000..1ae244b039
--- /dev/null
+++ b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\PageBuilder\ViewModel;
+
+use Magento\Backend\ViewModel\RequireJsConfigModifierInterface;
+use Magento\Framework\View\Element\Block\ArgumentInterface;
+
+/**
+ * Modifies requirejs configuration for the stage render frame
+ *
+ * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
+ * as the same origin policy will not allow us to load the templates within this iframe.
+ * It is important that this mapping is configured before requirejs-config.js to ensure the text! plugin is overridden
+ * for all requests.
+ */
+class StageRenderFrameRequireJsConfigModifier implements ArgumentInterface, RequireJsConfigModifierInterface
+{
+ /**
+ * @inheritDoc
+ */
+ public function modify(array $config): array
+ {
+ $config['map']['*'] = array_merge(
+ $config['map']['*'] ?? [],
+ [
+ 'text' => 'Magento_PageBuilder/js/master-format/render/requirejs/text',
+ 'Magento_PageBuilder/js/events' => 'Magento_PageBuilder/js/master-format/render/events'
+ ]
+ );
+ return $config;
+ }
+}
diff --git a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
index 6a95e8e87f..c400058706 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
+++ b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
@@ -14,6 +14,13 @@
<remove src="css/styles.css"/>
</head>
<body>
+ <referenceBlock name="require.js">
+ <arguments>
+ <argument name="config_modifier" xsi:type="object">
+ Magento\PageBuilder\ViewModel\StageRenderFrameRequireJsConfigModifier
+ </argument>
+ </arguments>
+ </referenceBlock>
<referenceContainer name="backend.page" remove="true"/>
<referenceContainer name="menu.wrapper" remove="true"/>
<referenceContainer name="root">
diff --git a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
index cd3c853b21..600c1f3656 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
+++ b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
@@ -4,32 +4,22 @@
* See COPYING.txt for license details.
*/

-/** @var \Magento\PageBuilder\Block\Adminhtml\Stage\Render $block */
+/**
+ * @var \Magento\PageBuilder\Block\Adminhtml\Stage\Render $block
+ * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
+ */
?>
-<script>
- <?php
- /**
- * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
- * as the same origin policy will not allow us to load the templates within this iframe.
- */
- ?>
- require.config({
- 'map': {
- '*': {
- 'text': 'Magento_PageBuilder/js/master-format/render/requirejs/text',
- 'Magento_PageBuilder/js/events': 'Magento_PageBuilder/js/master-format/render/events'
- }
- }
- });

- <?php
- /**
- * To be able to override the text plugin we need the Magento template engine to be used, as the template engine
- * within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
- * dependency blocks us. If we try to just override using the RequireJS config above our !text plugin will never
- * get overridden as our template engine cannot load.
- */
- ?>
+<?php
+$pageBuilderConfig = $block->getPageBuilderConfig();
+
+/**
+ * To be able to override the text plugin we need the Magento template engine to be used, as the template engine
+ * within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
+ * dependency blocks us. If we try to just override using the RequireJS config above our !text plugin will never
+ * get overridden as our template engine cannot load.
+ */
+$script = <<<SCRIPT
require([
'ko',
'Magento_Ui/js/lib/knockout/template/engine'
@@ -39,10 +29,11 @@
ko.uid = 0;
ko.setTemplateEngine(templateEngine);
});
-</script>
-<script>
+
require(['Magento_PageBuilder/js/master-format/render/frame'], function (listen) {
- listen(<?= /* @noEscape */ $block->getPageBuilderConfig(); ?>);
+ listen({$pageBuilderConfig});
});
-</script>
-<div>Page Builder Render Frame</div>
+SCRIPT;
+?>
+<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $script, false) ?>
+<div>Page Builder Render Frame</div>
\ No newline at end of file
113 changes: 113 additions & 0 deletions patches/commerce/ACSD-59582_2.2.5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
diff --git a/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
new file mode 100644
index 000000000..1ae244b03
--- /dev/null
+++ b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\PageBuilder\ViewModel;
+
+use Magento\Backend\ViewModel\RequireJsConfigModifierInterface;
+use Magento\Framework\View\Element\Block\ArgumentInterface;
+
+/**
+ * Modifies requirejs configuration for the stage render frame
+ *
+ * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
+ * as the same origin policy will not allow us to load the templates within this iframe.
+ * It is important that this mapping is configured before requirejs-config.js to ensure the text! plugin is overridden
+ * for all requests.
+ */
+class StageRenderFrameRequireJsConfigModifier implements ArgumentInterface, RequireJsConfigModifierInterface
+{
+ /**
+ * @inheritDoc
+ */
+ public function modify(array $config): array
+ {
+ $config['map']['*'] = array_merge(
+ $config['map']['*'] ?? [],
+ [
+ 'text' => 'Magento_PageBuilder/js/master-format/render/requirejs/text',
+ 'Magento_PageBuilder/js/events' => 'Magento_PageBuilder/js/master-format/render/events'
+ ]
+ );
+ return $config;
+ }
+}
diff --git a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
index 6a95e8e87..c40005870 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
+++ b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
@@ -14,6 +14,13 @@
<remove src="css/styles.css"/>
</head>
<body>
+ <referenceBlock name="require.js">
+ <arguments>
+ <argument name="config_modifier" xsi:type="object">
+ Magento\PageBuilder\ViewModel\StageRenderFrameRequireJsConfigModifier
+ </argument>
+ </arguments>
+ </referenceBlock>
<referenceContainer name="backend.page" remove="true"/>
<referenceContainer name="menu.wrapper" remove="true"/>
<referenceContainer name="root">
diff --git a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
index 6e96a2757..2586df2b3 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
+++ b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
@@ -10,33 +10,16 @@
*/
?>

-<?php
-/**
- * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
- * as the same origin policy will not allow us to load the templates within this iframe.
- */
-?>
<?php
$pageBuilderConfig = $block->getPageBuilderConfig();

-$script = <<<SCRIPT
- require.config({
- 'map': {
- '*': {
- 'text': 'Magento_PageBuilder/js/master-format/render/requirejs/text',
- 'Magento_PageBuilder/js/events': 'Magento_PageBuilder/js/master-format/render/events'
- }
- }
- });
-SCRIPT;
-
/**
* To be able to override the text plugin we need the Magento template engine to be used, as the template engine
* within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
* dependency blocks us. If we try to just override using the RequireJS config above our !text plugin will never
* get overridden as our template engine cannot load.
*/
-$script .= <<<SCRIPT
+$script = <<<SCRIPT
require([
'ko',
'Magento_Ui/js/lib/knockout/template/engine'
diff --git a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
index 8b495ce72..1ff74d860 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
@@ -31,6 +31,7 @@
<with args="stage">
<render></render>
</with>
- <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>
+ <!-- Do not modify the "sandbox" attribute without approval from a security engineer -->
+ <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts" style="position: absolute; width:0; height:0; border: none;"></iframe>
</if>
</div>
Loading

0 comments on commit d2e5320

Please sign in to comment.