-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from magento-commerce/1.1.50-release
1.1.50 Release
- Loading branch information
Showing
33 changed files
with
6,661 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
+ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.