Skip to content

Commit 03a6f4d

Browse files
Merge 2.4-develop into 2.4.0-develop
2 parents 0decc7f + cd77da6 commit 03a6f4d

File tree

209 files changed

+4136
-1202
lines changed

Some content is hidden

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

209 files changed

+4136
-1202
lines changed

app/code/Magento/AsynchronousOperations/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"require": {
88
"magento/framework": "*",
9+
"magento/framework-message-queue": "*",
910
"magento/framework-bulk": "*",
1011
"magento/module-authorization": "*",
1112
"magento/module-backend": "*",

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
<deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/>
3737
</after>
3838
<!--Make category-->
39-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
40-
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
39+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="goToCategoryPage"/>
4140
<actionGroup ref="CreateCategoryActionGroup" stepKey="createASubcategory">
4241
<argument name="categoryEntity" value="SimpleSubCategory"/>
4342
</actionGroup>

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundlePriceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public function testModifyMeta()
6868
];
6969
$priceParams = [
7070
'imports' => [
71-
'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
71+
'disabled' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
72+
'__disableTmpl' => ['disabled' => false],
7273
]
7374
];
7475
$priceMeta = [

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testModifyMeta()
5858
$weightParams = [
5959
'imports' => [
6060
'disabled' => 'ns = ${ $.ns }, index = ' . BundleWeight::CODE_WEIGHT_TYPE . ':checked',
61+
'__disableTmpl' => ['disabled' => false],
6162
]
6263
];
6364
$hasWeightParams = [

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleAdvancedPricing.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(ArrayManager $arrayManager)
3434
}
3535

3636
/**
37-
* {@inheritdoc}
37+
* @inheritdoc
3838
*/
3939
public function modifyMeta(array $meta)
4040
{
@@ -63,7 +63,7 @@ public function modifyMeta(array $meta)
6363
}
6464

6565
/**
66-
* {@inheritdoc}
66+
* @inheritdoc
6767
*/
6868
public function modifyData(array $data)
6969
{
@@ -88,7 +88,8 @@ private function modifyMsrpMeta(array $meta)
8888
$meta,
8989
[
9090
'imports' => [
91-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
91+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
92+
'__disableTmpl' => ['disabled' => false],
9293
]
9394
]
9495
);
@@ -103,7 +104,8 @@ private function modifyMsrpMeta(array $meta)
103104
$meta,
104105
[
105106
'imports' => [
106-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
107+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
108+
'__disableTmpl' => ['disabled' => false],
107109
]
108110
]
109111
);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleCustomOptions.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class BundleCustomOptions extends AbstractModifier
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
public function modifyMeta(array $meta)
2121
{
@@ -55,6 +55,7 @@ public function modifyCustomOptionsButton(array $meta, $group, $container, $butt
5555
if (!empty($meta[$group]['children'][$container]['children'][$button])) {
5656
$meta[$group]['children'][$container]['children'][$button]['arguments']['data']['config']['imports'] = [
5757
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
58+
'__disableTmpl' => ['visible' => false],
5859
];
5960
}
6061
return $meta;
@@ -79,6 +80,7 @@ public function getErrorMessage($sortOrder)
7980
'sortOrder' => $sortOrder,
8081
'imports' => [
8182
'visible' => 'ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
83+
'__disableTmpl' => ['visible' => false],
8284
],
8385
],
8486
],
@@ -87,7 +89,7 @@ public function getErrorMessage($sortOrder)
8789
}
8890

8991
/**
90-
* {@inheritdoc}
92+
* @inheritdoc
9193
*/
9294
public function modifyData(array $data)
9395
{

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ protected function getBundleHeader()
319319
* Get Bundle Options structure
320320
*
321321
* @return array
322+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
322323
*/
323324
protected function getBundleOptions()
324325
{
@@ -348,7 +349,8 @@ protected function getBundleOptions()
348349
'component' => 'Magento_Ui/js/dynamic-rows/record',
349350
'positionProvider' => 'product_bundle_container.position',
350351
'imports' => [
351-
'label' => '${ $.name }' . '.product_bundle_container.option_info.title:value'
352+
'label' => '${ $.name }' . '.product_bundle_container.option_info.title:value',
353+
'__disableTmpl' => ['label' => false],
352354
],
353355
],
354356
],
@@ -381,6 +383,7 @@ protected function getBundleOptions()
381383
'template' => 'ui/dynamic-rows/templates/default',
382384
'provider' => 'product_form.product_form_data_source',
383385
'dataProvider' => '${ $.dataScope }' . '.bundle_button_proxy',
386+
'__disableTmpl' => ['dataProvider' => false],
384387
'identificationDRProperty' => 'product_id',
385388
'identificationProperty' => 'product_id',
386389
'map' => [
@@ -395,9 +398,13 @@ protected function getBundleOptions()
395398
'selection_price_value' => '',
396399
'selection_qty' => '',
397400
],
398-
'links' => ['insertData' => '${ $.provider }:${ $.dataProvider }'],
401+
'links' => [
402+
'insertData' => '${ $.provider }:${ $.dataProvider }',
403+
'__disableTmpl' => ['insertData' => false],
404+
],
399405
'imports' => [
400406
'inputType' => '${$.provider}:${$.dataScope}.type',
407+
'__disableTmpl' => ['inputType' => false],
401408
],
402409
'source' => 'product',
403410
],
@@ -619,9 +626,11 @@ protected function getBundleSelections()
619626
'is_collection' => true,
620627
'imports' => [
621628
'inputType' => '${$.parentName}:inputType',
629+
'__disableTmpl' => ['inputType' => false],
622630
],
623631
'exports' => [
624632
'isDefaultValue' => '${$.parentName}:isDefaultValue.${$.index}',
633+
'__disableTmpl' => ['isDefaultValue' => false],
625634
],
626635
],
627636
],
@@ -702,7 +711,8 @@ protected function getBundleSelections()
702711
'validate-greater-than-zero' => true
703712
],
704713
'imports' => [
705-
'isInteger' => '${ $.provider }:${ $.parentScope }.selection_qty_is_integer'
714+
'isInteger' => '${ $.provider }:${ $.parentScope }.selection_qty_is_integer',
715+
'__disableTmpl' => ['isInteger' => false],
706716
],
707717
],
708718
],
@@ -723,6 +733,7 @@ protected function getBundleSelections()
723733
'sortOrder' => 110,
724734
'imports' => [
725735
'inputType' => '${$.parentName}:inputType',
736+
'__disableTmpl' => ['inputType' => false],
726737
],
727738
],
728739
],
@@ -764,7 +775,8 @@ protected function getSelectionPriceValue()
764775
'dataScope' => 'selection_price_value',
765776
'value' => '0.00',
766777
'imports' => [
767-
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
778+
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
779+
'__disableTmpl' => ['visible' => false],
768780
],
769781
'sortOrder' => 80,
770782
],
@@ -801,7 +813,8 @@ protected function getSelectionPriceType()
801813
]
802814
],
803815
'imports' => [
804-
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked'
816+
'visible' => '!ns = ${ $.ns }, index = ' . BundlePrice::CODE_PRICE_TYPE . ':checked',
817+
'__disableTmpl' => ['visible' => false],
805818
],
806819
'sortOrder' => 90,
807820
],

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function modifyMeta(array $meta)
7171
$meta,
7272
[
7373
'imports' => [
74-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
74+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
75+
'__disableTmpl' => ['disabled' => false],
7576
]
7677
]
7778
);
@@ -86,7 +87,8 @@ public function modifyMeta(array $meta)
8687
$meta,
8788
[
8889
'imports' => [
89-
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
90+
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked',
91+
'__disableTmpl' => ['disabled' => false],
9092
]
9193
]
9294
);

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleWeight.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(ArrayManager $arrayManager)
3030
}
3131

3232
/**
33-
* {@inheritdoc}
33+
* @inheritdoc
3434
*/
3535
public function modifyMeta(array $meta)
3636
{
@@ -73,15 +73,16 @@ public function modifyMeta(array $meta)
7373
[
7474
'imports' => [
7575
'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_WEIGHT_TYPE . ':checked',
76+
'__disableTmpl' => ['disabled' => false],
7677
]
7778
]
7879
);
79-
80+
8081
return $meta;
8182
}
8283

8384
/**
84-
* {@inheritdoc}
85+
* @inheritdoc
8586
*/
8687
public function modifyData(array $data)
8788
{

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,14 @@ public function getLayer()
136136
*/
137137
public function getLoadedProductCollection()
138138
{
139-
return $this->_getProductCollection();
139+
$collection = $this->_getProductCollection();
140+
141+
$categoryId = $this->getLayer()->getCurrentCategory()->getId();
142+
foreach ($collection as $product) {
143+
$product->setData('category_id', $categoryId);
144+
}
145+
146+
return $collection;
140147
}
141148

142149
/**

app/code/Magento/Catalog/Model/Product.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,14 @@ public function getIdBySku($sku)
725725
*/
726726
public function getCategoryId()
727727
{
728+
if ($this->hasData('category_id')) {
729+
return $this->getData('category_id');
730+
}
728731
$category = $this->_registry->registry('current_category');
729-
if ($category && in_array($category->getId(), $this->getCategoryIds())) {
730-
return $category->getId();
732+
$categoryId = $category ? $category->getId() : null;
733+
if ($categoryId && in_array($categoryId, $this->getCategoryIds())) {
734+
$this->setData('category_id', $categoryId);
735+
return $categoryId;
731736
}
732737
return false;
733738
}

app/code/Magento/Catalog/Model/Product/AttributeSet/Options.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,22 @@
1010
*/
1111
class Options implements \Magento\Framework\Data\OptionSourceInterface
1212
{
13+
1314
/**
1415
* @var array
1516
*/
1617
protected $options;
1718

19+
/**
20+
* @var \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory
21+
*/
22+
protected $collectionFactory;
23+
24+
/**
25+
* @var \Magento\Catalog\Model\ResourceModel\Product
26+
*/
27+
protected $product;
28+
1829
/**
1930
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $collectionFactory
2031
* @param \Magento\Catalog\Model\ResourceModel\Product $product
@@ -36,13 +47,6 @@ public function toOptionArray()
3647
$this->options = $this->collectionFactory->create()
3748
->setEntityTypeFilter($this->product->getTypeId())
3849
->toOptionArray();
39-
40-
array_walk(
41-
$this->options,
42-
function (&$option) {
43-
$option['__disableTmpl'] = true;
44-
}
45-
);
4650
}
4751

4852
return $this->options;

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenCategoriesPageActionGroup.xml

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

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
<severity value="CRITICAL"/>
2323
<testCaseId value="MAGETWO-84373"/>
2424
</annotations>
25-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToNewCatalog"/>
26-
<waitForPageLoad stepKey="wait1"/>
25+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="navigateToNewCatalog"/>
2726
<waitForLoadingMaskToDisappear stepKey="wait2" />
2827
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
2928
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="enterCategoryName"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3131
</after>
3232
<!--Open Category Page-->
33-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
34-
<waitForPageLoad stepKey="waitForPageToLoaded"/>
33+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3534
<!--Create subcategory under parent category -->
3635
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
3736
<waitForPageLoad stepKey="waitForCategoryToLoad"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3030
</after>
3131
<!--Open Category Page-->
32-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
33-
<waitForPageLoad stepKey="waitForPageToLoaded"/>
32+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3433
<!--Create subcategory under parent category -->
3534
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
3635
<waitForPageLoad stepKey="waitForCategoryToLoad"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3131
</after>
3232
<!--Open Category Page-->
33-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
34-
<waitForPageLoad stepKey="waitForPageToLoaded"/>
33+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3534
<!--Create subcategory under parent category -->
3635
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
3736
<waitForPageLoad stepKey="waitForCategoryToLoad"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@
9999
<seeInField selector="{{AdminCatalogStorefrontConfigSection.productsPerPageDefaultValue}}" userInput="12" stepKey="seeDefaultValueProductPerPage"/>
100100
<!--Open Category Page and select created category-->
101101
<comment userInput="Open Category Page and select created category" stepKey="commentOpenCategoryPage"/>
102-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
103-
<waitForPageLoad stepKey="waitForPageToLoad1"/>
102+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
104103
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
105104
<waitForPageLoad stepKey="waitForPageToLoad0"/>
106105
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="selectCreatedCategory"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3030
</after>
3131
<!--Open Category Page-->
32-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
33-
<waitForPageLoad stepKey="waitForPageToLoaded"/>
32+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3433
<!--Create subcategory under parent category -->
3534
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
3635
<waitForPageLoad stepKey="waitForCategoryToLoad"/>

0 commit comments

Comments
 (0)