Skip to content

Commit aae14cc

Browse files
committed
Merge branch '2.4-develop' of github.com:ptylek/magento2 into fix-toolbar_initialize_once-25934
2 parents 7efd88d + 735579d commit aae14cc

File tree

248 files changed

+12972
-994
lines changed

Some content is hidden

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

248 files changed

+12972
-994
lines changed

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

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

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/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/Product/Price/Validation/Result.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ public function getFailedItems()
8383
}
8484
}
8585

86+
/**
87+
* Clear validation messages to prevent wrong validation for subsequent price update.
88+
* Work around for backward compatible changes.
89+
*/
90+
$this->failedItems = [];
91+
8692
return $failedItems;
8793
}
8894
}

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
}
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>
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="AssertAdminCategoryIsListedInCategoriesTreeActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="seeCategoryInTree"/>
16+
</actionGroup>
17+
</actionGroups>
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="AssertAdminCategoryIsNotListedInCategoriesTreeActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="doNotSeeCategoryInTree"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="StorefrontSwitchStoreActionGroup">
12+
<annotations>
13+
<description>Switch the Storefront to the provided Store.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="storeName" type="string"/>
17+
</arguments>
18+
<click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickOnSwitchStoreButton"/>
19+
<click selector="{{StorefrontFooterSection.storeLink(storeName)}}" stepKey="selectStoreToSwitchOn"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,19 @@
3131
<!--Open Category Page-->
3232
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
3333
<!--Create subcategory under parent category -->
34-
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
35-
<waitForPageLoad stepKey="waitForCategoryToLoad"/>
36-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}" stepKey="selectCategory"/>
37-
<waitForPageLoad stepKey="waitForPageToLoad"/>
38-
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/>
39-
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SimpleSubCategory.name}}" stepKey="addSubCategoryName"/>
40-
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/>
41-
<checkOption selector="{{AdminCategoryBasicFieldSection.IncludeInMenu}}" stepKey="enableIncludeInMenu"/>
42-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveSubCategory"/>
43-
<waitForPageLoad stepKey="waitForSecondCategoryToSave"/>
44-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/>
34+
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="openCreatedCategory">
35+
<argument name="Category" value="$$createCategory$$"/>
36+
</actionGroup>
37+
<actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory">
38+
<argument name="categoryEntity" value="SimpleSubCategory"/>
39+
</actionGroup>
4540
<!-- Verify Parent Category is visible in navigation menu and Sub category is not visible in navigation menu -->
46-
<amOnPage url="$$createCategory.name_lwr$$/{{SimpleSubCategory.name_lwr}}.html" stepKey="openCategoryStoreFrontPage"/>
47-
<waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/>
48-
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryOnStoreNavigationBar"/>
49-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigation"/>
41+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomepage"/>
42+
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryOnStoreNavigationBar">
43+
<argument name="categoryName" value="$$createCategory.name$$"/>
44+
</actionGroup>
45+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="doNotSeeSubCategoryOnStoreNavigation">
46+
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
47+
</actionGroup>
5048
</test>
5149
</tests>

0 commit comments

Comments
 (0)