Skip to content

Commit 347602f

Browse files
committed
Merge branch '2.4-develop' into korostii-patch-27523
2 parents 8991733 + f8f1e5e commit 347602f

File tree

255 files changed

+9709
-1729
lines changed

Some content is hidden

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

255 files changed

+9709
-1729
lines changed

app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml

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

app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
</actionGroup>
9595

9696
<!--Navigate to Product attribute page-->
97-
<amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/>
98-
<waitForPageLoad stepKey="waitForPageLoad"/>
97+
<actionGroup ref="AdminNavigateToNewProductAttributePageActionGroup" stepKey="navigateToNewProductAttributePage"/>
9998
<fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/>
10099
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/>
101100
<click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/>

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Save.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ public function execute()
261261
unset($data['apply_to']);
262262
}
263263

264+
if ($model->getBackendType() == 'static' && !$model->getIsUserDefined()) {
265+
$data['frontend_class'] = $model->getFrontendClass();
266+
}
267+
264268
$model->addData($data);
265269

266270
if (!$attributeId) {

app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,20 @@ protected function _reindexRows($changedIds = [])
368368
$productsTypes = $this->getProductsTypes($changedIds);
369369
$parentProductsTypes = $this->getParentProductsTypes($changedIds);
370370

371-
$changedIds = array_merge($changedIds, ...array_values($parentProductsTypes));
371+
$changedIds = array_unique(array_merge($changedIds, ...array_values($parentProductsTypes)));
372372
$productsTypes = array_merge_recursive($productsTypes, $parentProductsTypes);
373373

374374
if ($changedIds) {
375375
$this->deleteIndexData($changedIds);
376376
}
377-
foreach ($productsTypes as $productType => $entityIds) {
378-
$indexer = $this->_getIndexer($productType);
377+
378+
$typeIndexers = $this->getTypeIndexers();
379+
foreach ($typeIndexers as $productType => $indexer) {
380+
$entityIds = $productsTypes[$productType] ?? [];
381+
if (empty($entityIds)) {
382+
continue;
383+
}
384+
379385
if ($indexer instanceof DimensionalIndexerInterface) {
380386
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
381387
$this->tableMaintainer->createMainTmpTable($dimensions);

app/code/Magento/Catalog/Model/Layer/Filter/Price/Render.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public function renderRangeLabel($fromPrice, $toPrice)
7272
}
7373

7474
/**
75+
* Prepare range data
76+
*
7577
* @param int $range
7678
* @param int[] $dbRanges
7779
* @return array
@@ -81,12 +83,10 @@ public function renderRangeData($range, $dbRanges)
8183
if (empty($dbRanges)) {
8284
return [];
8385
}
84-
$lastIndex = array_keys($dbRanges);
85-
$lastIndex = $lastIndex[count($lastIndex) - 1];
8686

8787
foreach ($dbRanges as $index => $count) {
88-
$fromPrice = $index == 1 ? '' : ($index - 1) * $range;
89-
$toPrice = $index == $lastIndex ? '' : $index * $range;
88+
$fromPrice = $index == 1 ? 0 : ($index - 1) * $range;
89+
$toPrice = $index * $range;
9090
$this->itemDataBuilder->addItemData(
9191
$this->renderRangeLabel($fromPrice, $toPrice),
9292
$fromPrice . '-' . $toPrice,

app/code/Magento/Catalog/Model/ResourceModel/Category/AggregateCount.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
use Magento\Catalog\Model\Category;
99

1010
/**
11+
* Aggregate count for parent category after deleting child category
12+
*
1113
* Class AggregateCount
1214
*/
1315
class AggregateCount
1416
{
1517
/**
18+
* Reduces children count for parent categories
19+
*
1620
* @param Category $category
1721
* @return void
1822
*/
@@ -25,9 +29,7 @@ public function processDelete(Category $category)
2529
*/
2630
$parentIds = $category->getParentIds();
2731
if ($parentIds) {
28-
$childDecrease = $category->getChildrenCount() + 1;
29-
// +1 is itself
30-
$data = ['children_count' => new \Zend_Db_Expr('children_count - ' . $childDecrease)];
32+
$data = ['children_count' => new \Zend_Db_Expr('children_count - 1')];
3133
$where = ['entity_id IN(?)' => $parentIds];
3234
$resourceModel->getConnection()->update($resourceModel->getEntityTable(), $data, $where);
3335
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateCategoryWithInactiveIncludeInMenuActionGroup" extends="CreateCategoryActionGroup">
12+
<annotations>
13+
<description>EXTENDS: CreateCategory. Add "disableIncludeInMenuOption" step.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="disableIncludeInMenuOption"
20+
after="seeCategoryPageTitle"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateInactiveCategoryActionGroup" extends="CreateCategoryActionGroup">
12+
<annotations>
13+
<description>EXTENDS: CreateCategory. Add "disableCategory" step.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
17+
</arguments>
18+
19+
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="disableCategory"
20+
after="seeCategoryPageTitle"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminEnableCategoryActionGroup">
12+
<annotations>
13+
<description>Enable the category</description>
14+
</annotations>
15+
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="enableCategory"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminCategoryIsInactiveActionGroup">
12+
<annotations>
13+
<description>Verify the category is disabled</description>
14+
</annotations>
15+
16+
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="seeCategoryIsDisabled"/>
17+
</actionGroup>
18+
</actionGroups>

0 commit comments

Comments
 (0)