Skip to content

Commit 0dd73ec

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-3255
2 parents b0dac64 + edcd0dc commit 0dd73ec

File tree

181 files changed

+8147
-502
lines changed

Some content is hidden

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

181 files changed

+8147
-502
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
<testCaseId value="MC-115"/>
1919
<group value="Bundle"/>
2020
<group value="cloud"/>
21-
<skip>
22-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
23-
</skip>
21+
<!-- Excluded from PR builds due to AC-12124 -->
22+
<group value="pr_exclude"/>
2423
</annotations>
2524
<before>
2625
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php

+25-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Product\Type;
1212
use Magento\Catalog\Model\ProductIdLocatorInterface;
1313
use Magento\Customer\Api\GroupRepositoryInterface;
14+
use Magento\Directory\Model\Currency;
1415
use Magento\Framework\Api\FilterBuilder;
1516
use Magento\Framework\Api\SearchCriteriaBuilder;
1617
use Magento\Framework\Exception\LocalizedException;
@@ -426,7 +427,7 @@ private function checkUnique(
426427
foreach ($prices[$tierPrice->getSku()] as $price) {
427428
if ($price !== $tierPrice) {
428429
$checkWebsiteValue = $isExistingPrice ? $this->compareWebsiteValue($price, $tierPrice)
429-
: ($price->getWebsiteId() == $tierPrice->getWebsiteId());
430+
: $this->compareWebsiteValueNewPrice($price, $tierPrice);
430431
if (strtolower($price->getCustomerGroup()) === strtolower($tierPrice->getCustomerGroup())
431432
&& $price->getQuantity() == $tierPrice->getQuantity()
432433
&& $checkWebsiteValue
@@ -547,6 +548,29 @@ private function compareWebsiteValue(TierPriceInterface $price, TierPriceInterfa
547548
&& $price->getWebsiteId() != $tierPrice->getWebsiteId();
548549
}
549550

551+
/**
552+
* Compare Website Values between for new price records
553+
*
554+
* @param TierPriceInterface $price
555+
* @param TierPriceInterface $tierPrice
556+
* @return bool
557+
*/
558+
private function compareWebsiteValueNewPrice(TierPriceInterface $price, TierPriceInterface $tierPrice): bool
559+
{
560+
if ($price->getWebsiteId() == $this->allWebsitesValue ||
561+
$tierPrice->getWebsiteId() == $this->allWebsitesValue
562+
) {
563+
$baseCurrency = $this->scopeConfig->getValue(Currency::XML_PATH_CURRENCY_BASE, 'default');
564+
$websiteId = max($price->getWebsiteId(), $tierPrice->getWebsiteId());
565+
$website = $this->websiteRepository->getById($websiteId);
566+
$websiteCurrency = $website->getBaseCurrencyCode();
567+
568+
return $baseCurrency == $websiteCurrency;
569+
}
570+
571+
return $price->getWebsiteId() == $tierPrice->getWebsiteId();
572+
}
573+
550574
/**
551575
* @inheritDoc
552576
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group verifies that the total number of expanded categories in the admin category tree widget matches the provided expected count.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="ExpectedCount" type="string" defaultValue="1"/>
17+
</arguments>
18+
<grabMultiple selector="{{CmsNewWidgetUpdateLayoutSection.CountAllNestedCat}}" stepKey="countNestedCategory"/>
19+
<assertCount stepKey="check">
20+
<expectedResult type="int">{{ExpectedCount}}</expectedResult>
21+
<actualResult type="variable">countNestedCategory</actualResult>
22+
</assertCount>
23+
</actionGroup>
24+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminExpandCategoryTreeWidgetActionGroup">
12+
<annotations>
13+
<description>This action group expands a specified category in the admin category tree widget by clicking on the expand icon and waiting for the page to load.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="CategoryName" type="string" defaultValue="Category 1"/>
17+
</arguments>
18+
<click selector="{{CmsNewWidgetUpdateLayoutSection.BranchCat(CategoryName)}}" stepKey="clickExpandCategory"/>
19+
<waitForPageLoad stepKey="waitForCategoryExpand"/>
20+
</actionGroup>
21+
</actionGroups>

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
<testCaseId value="MC-103"/>
1919
<group value="Catalog"/>
2020
<group value="cloud"/>
21-
<skip>
22-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
23-
</skip>
21+
<!-- Excluded from PR builds due to AC-12124 -->
22+
<group value="pr_exclude"/>
2423
</annotations>
2524
<before>
2625
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MC-189"/>
1818
<group value="Catalog"/>
19-
<skip>
20-
<issueId value="AC-12124">Fotorama lib isn't loaded</issueId>
21-
</skip>
19+
<!-- Excluded from PR builds due to AC-12124 -->
20+
<group value="pr_exclude"/>
2221
</annotations>
2322

2423
<before>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminValidateMixedNestedCategoryInWidgetTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Validate the proper loading of mixed nested categories in the category widget"/>
15+
<title value="Ensure mixed nested categories of Level 5 and beyond load correctly in the category widget"/>
16+
<description value="This test verifies that mixed nested categories, including Level 5 and higher, with and without children, are loaded properly in the category widget in the admin panel."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-12647"/>
19+
<group value="catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createBaseCategory"/>
23+
<createData entity="SubCategoryWithParent" stepKey="createLevelTwoCategory">
24+
<field key="name">SubCategoryLvl-2</field>
25+
<field key="parent_id">$$createBaseCategory.id$$</field>
26+
<requiredEntity createDataKey="createBaseCategory"/>
27+
</createData>
28+
<createData entity="SubCategoryWithParent" stepKey="createLevelThreeCategory">
29+
<field key="name">SubCategoryLvl-3</field>
30+
<field key="parent_id">$$createLevelTwoCategory.id$$</field>
31+
<requiredEntity createDataKey="createLevelTwoCategory"/>
32+
</createData>
33+
<createData entity="SubCategoryWithParent" stepKey="createLevelFourCategory">
34+
<field key="name">SubCategoryLvl-4</field>
35+
<field key="parent_id">$$createLevelThreeCategory.id$$</field>
36+
<requiredEntity createDataKey="createLevelThreeCategory"/>
37+
</createData>
38+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveCategory">
39+
<field key="name">SubCategoryLvl-5</field>
40+
<field key="parent_id">$$createLevelFourCategory.id$$</field>
41+
<requiredEntity createDataKey="createLevelFourCategory"/>
42+
</createData>
43+
<createData entity="SubCategoryWithParent" stepKey="createLevelSixCategory">
44+
<field key="name">SubCategoryLvl-6</field>
45+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
46+
<requiredEntity createDataKey="createLevelFiveCategory"/>
47+
</createData>
48+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveSubCategory">
49+
<field key="name">SubCategoryLvl-5-1</field>
50+
<field key="parent_id">$$createLevelFiveCategory.id$$</field>
51+
<requiredEntity createDataKey="createLevelFiveCategory"/>
52+
</createData>
53+
<createData entity="SubCategoryWithParent" stepKey="createLevelFiveOneSubCategory">
54+
<field key="name">SubCategoryLvl-5-1-1</field>
55+
<field key="parent_id">$$createLevelFiveSubCategory.id$$</field>
56+
<requiredEntity createDataKey="createLevelFiveSubCategory"/>
57+
</createData>
58+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
59+
</before>
60+
<after>
61+
<deleteData createDataKey="createLevelFiveOneSubCategory" stepKey="deleteLevelFiveOneSubCategory"/>
62+
<deleteData createDataKey="createLevelFiveSubCategory" stepKey="deleteLevelFiveSubCategory"/>
63+
<deleteData createDataKey="createLevelSixCategory" stepKey="deleteLevelSixCategory"/>
64+
<deleteData createDataKey="createLevelFiveCategory" stepKey="deleteLevelFiveCategory"/>
65+
<deleteData createDataKey="createLevelFourCategory" stepKey="deleteLevelFourCategory"/>
66+
<deleteData createDataKey="createLevelThreeCategory" stepKey="deleteLevelThreeCategory"/>
67+
<deleteData createDataKey="createLevelTwoCategory" stepKey="deleteLevelTwoCategory"/>
68+
<deleteData createDataKey="createBaseCategory" stepKey="deleteDefaultCategory"/>
69+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
70+
</after>
71+
72+
<!-- Start creating a new widget. Note that we don't need to save it for the cause of the test. -->
73+
<actionGroup ref="AdminCreateSpecificEntityWidgetActionGroup" stepKey="startCreatingWidget">
74+
<argument name="widget" value="CatalogCategoryLinkSpecifiedCategory"/>
75+
</actionGroup>
76+
<click selector="{{AdminNewWidgetSection.storefrontProperties}}" stepKey="clickStorefrontProperties"/>
77+
78+
<!-- Expand all previously created categories one by one. -->
79+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandDefaultCategoryTree">
80+
<argument name="CategoryName" value="Default Category"/>
81+
</actionGroup>
82+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFirstLevelCategoryTree">
83+
<argument name="CategoryName" value="$createBaseCategory.name$"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSecondLevelCategoryTree">
86+
<argument name="CategoryName" value="$createLevelTwoCategory.name$"/>
87+
</actionGroup>
88+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandThirdLevelCategoryTree">
89+
<argument name="CategoryName" value="$createLevelThreeCategory.name$"/>
90+
</actionGroup>
91+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFourthLevelCategoryTree">
92+
<argument name="CategoryName" value="$createLevelFourCategory.name$"/>
93+
</actionGroup>
94+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthLevelCategoryTree">
95+
<argument name="CategoryName" value="$createLevelFiveCategory.name$"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandSixthLevelCategoryTree">
98+
<argument name="CategoryName" value="$createLevelSixCategory.name$"/>
99+
</actionGroup>
100+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthSubCategoryTree">
101+
<argument name="CategoryName" value="$createLevelFiveSubCategory.name$"/>
102+
</actionGroup>
103+
<actionGroup ref="AdminExpandCategoryTreeWidgetActionGroup" stepKey="expandFifthOneSubCategoryTree">
104+
<argument name="CategoryName" value="$createLevelFiveOneSubCategory.name$"/>
105+
</actionGroup>
106+
107+
<!-- Check the total number of expanded categories in the category tree widget ensuring all of them are loaded. -->
108+
<actionGroup ref="AdminAssertCategoryCountInCategoryTreeWidgetActionGroup" stepKey="checkCategoryCount">
109+
<argument name="ExpectedCount" value="9"/>
110+
</actionGroup>
111+
</test>
112+
</tests>

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

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<group value="Catalog"/>
1818
<severity value="AVERAGE"/>
1919
<group value="cloud"/>
20+
<!-- Excluded from PR builds due to AC-12124 -->
21+
<group value="pr_exclude"/>
2022
</annotations>
2123
<before>
2224
<magentoCLI command="config:set system/upload_configuration/enable_resize 0" stepKey="disableImageResizing"/>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml

+30-26
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
7+
/**
8+
* @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer
9+
* @var \Magento\Framework\Escaper $escaper
10+
*/
811
?>
912

1013
<?php $_divId = 'tree' . $block->getId() ?>
11-
<div id="<?= $block->escapeHtmlAttr($_divId) ?>" class="tree"></div>
14+
<div id="<?= $escaper->escapeHtmlAttr($_divId) ?>" class="tree"></div>
1215
<?php
1316
$isUseMassAction = $block->getUseMassaction() ? 1 : 0;
1417
$isAnchorOnly = $block->getIsAnchorOnly() ? 1 : 0;
@@ -124,29 +127,30 @@ require(['jquery', 'jquery/jstree/jquery.jstree'], function($) {
124127
125128
function handleOpenNode(e, data) {
126129
let parentNode = data.node;
127-
128-
if (parentNode.children.length > 0) {
129-
let childNode = data.instance.get_node(parentNode.children, false);
130-
131-
// Check if the child node has no children (is not yet loaded)
132-
if (childNode.children && childNode.children.length === 0
133-
&& childNode.original && !childNode.original.lastNode) {
134-
$.ajax({
135-
url: '{$block->escapeJs($block->escapeUrl($block->getLoadTreeUrl()))}',
136-
data: {
137-
id: childNode.original.id,
138-
store: childNode.original.store,
139-
form_key: FORM_KEY
140-
},
141-
dataType: 'json',
142-
success: function (response) {
143-
handleSuccessResponse(response, childNode, data);
144-
},
145-
error: function (jqXHR, status, error) {
146-
console.log(status + ': ' + error + 'Response text:' + jqXHR.responseText);
147-
}
148-
});
149-
}
130+
if (parentNode && parentNode.children.length > 0) {
131+
parentNode.children.forEach(function(childId) {
132+
let childNode = data.instance.get_node(childId, false);
133+
// Check if the child node has no children (is not yet loaded)
134+
if (childNode.children && childNode.children.length === 0
135+
&& childNode.original && !childNode.original.lastNode) {
136+
$.ajax({
137+
url: '{$block->escapeJs($block->escapeUrl($block->getLoadTreeUrl()))}',
138+
type: "POST",
139+
data: {
140+
id: childNode.original.id,
141+
store: childNode.original.store,
142+
form_key: FORM_KEY
143+
},
144+
dataType: 'json',
145+
success: function (response) {
146+
handleSuccessResponse(response, childNode, data);
147+
},
148+
error: function (jqXHR, status, error) {
149+
console.log(status + ': ' + error + 'Response text:' + jqXHR.responseText);
150+
}
151+
});
152+
}
153+
})
150154
}
151155
}
152156
@@ -179,7 +183,7 @@ script;
179183
?>
180184
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
181185
'overflow-x: auto;',
182-
'#tree' . $block->escapeJs($block->getId())
186+
'#tree' . $escaper->escapeJs($block->getId())
183187
);
184188
?>
185189
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>

app/code/Magento/Cms/Model/Wysiwyg/DefaultConfigProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Fram
3333
{
3434
$config->addData([
3535
'tinymce' => [
36-
'toolbar' => 'formatselect | bold italic underline | alignleft aligncenter alignright | '
36+
'toolbar' => ' blocks | formatselect | bold italic underline | alignleft aligncenter alignright | '
3737
. 'bullist numlist | link table charmap',
3838
'plugins' => implode(
3939
' ',

app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
<data key="path">cms/wysiwyg/editor</data>
2323
<data key="scope_id">0</data>
2424
<data key="label">Yes</data>
25-
<data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter</data>
25+
<data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter</data>
2626
</entity>
2727
</entities>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/MediaGallerySection.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<element name="UploadImageNew" type="file" selector="#upload_image"/>
2424
<element name="UploadImageSelector" type="file" selector="#fileUploader"/>
2525
<element name="UploadImageWithUploaderId" type="file" selector="#fileUploader + .uppy-Root .uppy-Dashboard-input"/>
26-
<element name="OkBtn" type="button" selector=".tox-dialog__footer button[title='Save']"/>
26+
<element name="OkBtn" type="button" selector=".tox-dialog__footer button[aria-label='Save']"/>
2727
<element name="insertBtn" type="button" selector="#insert"/>
2828
<element name="InsertFile" type="text" selector="#insert_files" timeout="30"/>
2929
<element name="CreateFolder" type="button" selector="#new_folder" timeout="30"/>

0 commit comments

Comments
 (0)