Skip to content

Commit 0020429

Browse files
committed
Merge remote-tracking branch 'mainline/2.4-develop' into AC-252
2 parents 7bc6c20 + 912857f commit 0020429

File tree

51 files changed

+302
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+302
-174
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/WYSIWYGConfigData.xml

Lines changed: 0 additions & 23 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
<before>
1212
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
1313
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
14-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" />
14+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
15+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
16+
</actionGroup>
1517
</before>
1618
<annotations>
1719
<features value="Catalog"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
<before>
2222
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2323
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
24-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" />
24+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
25+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
26+
</actionGroup>
2527
</before>
2628

2729
<after>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@
1313
<features value="Catalog"/>
1414
<stories value="Create product Attribute"/>
1515
<title value="Admin create text editor product attribute test"/>
16-
<description value="Create text editor product attribute with TinyMCE4 enabled"/>
16+
<description value="Create text editor product attribute with TinyMCE enabled"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-6338"/>
1919
<group value="catalog"/>
2020
</annotations>
2121
<before>
2222
<!-- Enable WYSIWYG editor -->
23-
<magentoCLI command="config:set {{EnableWYSIWYG.path}} {{EnableWYSIWYG.value}}" stepKey="enableWYSIWYG"/>
23+
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
2424

2525
<!-- Enable TinyMCE 4 -->
26-
<magentoCLI command="config:set {{EnableTinyMCE4.path}} {{EnableTinyMCE4.value}}" stepKey="enableTinyMCE4"/>
26+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
27+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
28+
</actionGroup>
2729

2830
<!-- Login as admin -->
2931
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2222
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
23-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" />
23+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
24+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
25+
</actionGroup>
2426
<createData stepKey="myProductAttributeCreation" entity="productAttributeWysiwyg"/>
2527
<createData stepKey="myProductAttributeSetAssign" entity="AddToDefaultSet">
2628
<requiredEntity createDataKey="myProductAttributeCreation"/>

app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifyDefaultWYSIWYGToolbarOnProductTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2222
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
23-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/>
23+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE">
24+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
25+
</actionGroup>
2426
</before>
2527
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/>
2628
<waitForPageLoad stepKey="wait"/>

app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest/VerifydefaultcontrolsonproductshortdescriptionTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2222
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
23-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4"/>
23+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE">
24+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
25+
</actionGroup>
2426
</before>
2527
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/>
2628
<waitForPageLoad stepKey="wait"/>

app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml renamed to app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,22 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11-
<test name="VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest">
11+
<test name="VerifyTinyMCEIsNativeWYSIWYGOnCatalogTest">
1212
<annotations>
1313
<features value="Catalog"/>
1414
<stories value="MAGETWO-72137-Apply new WYSIWYG on Categories Page"/>
1515
<group value="Catalog"/>
16-
<title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Catalog Page"/>
17-
<description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Catalog Page"/>
16+
<title value="Admin should see TinyMCE is the native WYSIWYG on Catalog Page"/>
17+
<description value="Admin should see TinyMCE is the native WYSIWYG on Catalog Page"/>
1818
<severity value="CRITICAL"/>
1919
<testCaseId value="MAGETWO-82551"/>
2020
</annotations>
2121
<before>
2222
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2323
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
24-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" />
24+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
25+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
26+
</actionGroup>
2527
</before>
2628
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToNewCatalog"/>
2729
<waitForLoadingMaskToDisappear stepKey="wait2" />

app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml renamed to app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEIsNativeWYSIWYGOnProductTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10-
<test name="VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest">
10+
<test name="VerifyTinyMCEIsNativeWYSIWYGOnProductTest">
1111
<annotations>
1212
<features value="Catalog"/>
1313
<stories value="MAGETWO-72114-TinyMCE v4.6 as a native WYSIWYG editor"/>
1414
<group value="Catalog"/>
15-
<title value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Product Page"/>
16-
<description value="Admin should see TinyMCEv4.6 is the native WYSIWYG on Product Page"/>
15+
<title value="Admin should see TinyMCE is the native WYSIWYG on Product Page"/>
16+
<description value="Admin should see TinyMCE is the native WYSIWYG on Product Page"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-81819"/>
1919
</annotations>
2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginGetFromGeneralFile"/>
2222
<actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/>
23-
<actionGroup ref="CliEnableTinyMCE4ActionGroup" stepKey="switchToTinyMCE4" />
23+
<actionGroup ref="CliEnableTinyMCEActionGroup" stepKey="enableTinyMCE" >
24+
<argument name="TinyMCEValue" value="{{EnableTinyMCE.value}}"/>
25+
</actionGroup>
2426
</before>
2527
<amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/>
2628
<waitForPageLoad stepKey="wait1"/>

app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php

Lines changed: 31 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66
*/
77
namespace Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Indexer;
88

9+
use Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer;
910
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
1011
use Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider;
1112

1213
/**
13-
* Class ReindexProduct. Add configurable sub-products to reindex
14+
* Add configurable sub-products to reindex
1415
*/
1516
class ProductRuleReindex
1617
{
1718
/**
18-
* @var \Magento\ConfigurableProduct\Model\Product\Type\Configurable
19+
* @var Configurable
1920
*/
2021
private $configurable;
2122

2223
/**
23-
* @var \Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider
24+
* @var ConfigurableProductsProvider
2425
*/
2526
private $configurableProductsProvider;
2627

@@ -37,61 +38,47 @@ public function __construct(
3738
}
3839

3940
/**
40-
* @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject
41+
* Reindex configurable product with sub-products
42+
*
43+
* @param ProductRuleIndexer $subject
4144
* @param \Closure $proceed
4245
* @param int $id
43-
*
4446
* @return void
4547
*/
46-
public function aroundExecuteRow(
47-
\Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject,
48-
\Closure $proceed,
49-
$id
50-
) {
48+
public function aroundExecuteRow(ProductRuleIndexer $subject, \Closure $proceed, $id)
49+
{
50+
$isReindexed = false;
51+
5152
$configurableProductIds = $this->configurableProductsProvider->getIds([$id]);
52-
$this->reindexSubProducts($configurableProductIds, $subject);
53-
if (!$configurableProductIds) {
54-
$proceed($id);
53+
if ($configurableProductIds) {
54+
$subProducts = array_values($this->configurable->getChildrenIds($id)[0]);
55+
if ($subProducts) {
56+
$subject->executeList(array_merge([$id], $subProducts));
57+
$isReindexed = true;
58+
}
5559
}
56-
}
5760

58-
/**
59-
* @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject
60-
* @param \Closure $proceed
61-
* @param array $ids
62-
*
63-
* @return void
64-
*/
65-
public function aroundExecuteList(
66-
\Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject,
67-
\Closure $proceed,
68-
array $ids
69-
) {
70-
$configurableProductIds = $this->configurableProductsProvider->getIds($ids);
71-
$subProducts = $this->reindexSubProducts($configurableProductIds, $subject);
72-
$ids = array_diff($ids, $configurableProductIds, $subProducts);
73-
if ($ids) {
74-
$proceed($ids);
61+
if (!$isReindexed) {
62+
$proceed($id);
7563
}
7664
}
7765

7866
/**
79-
* @param array $configurableIds
80-
* @param \Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject
67+
* Add sub-products to reindex
8168
*
69+
* @param ProductRuleIndexer $subject
70+
* @param array $ids
8271
* @return array
72+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
8373
*/
84-
private function reindexSubProducts(
85-
array $configurableIds,
86-
\Magento\CatalogRule\Model\Indexer\Product\ProductRuleIndexer $subject
87-
) {
88-
$subProducts = [];
89-
if ($configurableIds) {
90-
$subProducts = array_values($this->configurable->getChildrenIds($configurableIds)[0]);
91-
if ($subProducts) {
92-
$subject->executeList($subProducts);
93-
}
74+
public function beforeExecuteList(ProductRuleIndexer $subject, array $ids): array
75+
{
76+
$configurableProductIds = $this->configurableProductsProvider->getIds($ids);
77+
if ($configurableProductIds) {
78+
$subProducts = array_values($this->configurable->getChildrenIds($configurableProductIds)[0]);
79+
$ids = array_unique(array_merge($ids, $subProducts));
9480
}
95-
return $subProducts;
81+
82+
return [$ids];
9683
}
9784
}

0 commit comments

Comments
 (0)