Skip to content

Commit bd3d00b

Browse files
committed
Merge branch '2.4-develop' of github.com:magento-gl/magento2ce into AC-15495-Utility-Support
2 parents a4a3d24 + 9bcd880 commit bd3d00b

File tree

11,532 files changed

+29696
-27038
lines changed

Some content is hidden

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

11,532 files changed

+29696
-27038
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**

Gruntfile.js.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55

66
// For performance use one level down: 'name/{,*/}*.js'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ We encourage experts from the Community to help us with GitHub routines such as
4141
- [Learn more about the Maintainer role](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
4242
- [Maintainer's Handbook](https://developer.adobe.com/commerce/contributor/guides/maintainers/handbook/)
4343

44-
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://magento.com/magento-contributors#maintainers)
44+
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
4545

4646
### Leaders
4747

48-
Adobe highly appreciates contributions that help us to improve the code, clarify the documentation, and increase test coverage. Check out our Community leaders, superstars, and superheroes on the [leaderboard](https://magento.biterg.io/app/kibana#/dashboard/41dc0c60-fa06-11eb-bbaa-dd6ca6f8fda8?_g=()).
48+
Adobe highly appreciates contributions that help us to improve the code, clarify the documentation, and increase test coverage. Check out our Community leaders, superstars, and superheroes on the [leaderboard](https://github.com/magento/magento2/graphs/contributors).
4949

50-
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://magento.com/magento-contributors)
50+
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png)](https://github.com/magento/magento2/graphs/contributors)
5151

5252
### Labeling
5353

app/autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/**
33
* Register basic autoloader that uses include path
44
*
5-
* Copyright © Magento, Inc. All rights reserved.
6-
* See COPYING.txt for license details.
5+
* Copyright 2012 Adobe
6+
* All Rights Reserved.
77
*/
88
declare(strict_types=1);
99

app/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**

app/code/Magento/Catalog/Block/Adminhtml/Category/Checkboxes/Tree.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ public function setCategoryIds($ids)
5858
$ids = [(int)$ids];
5959
}
6060
$this->_selectedIds = $ids;
61+
62+
// Pre-compute expanded paths for all selected categories so that
63+
// ancestors are marked as expanded before the JSON is generated.
64+
$this->_expandedPath = [];
65+
if (!empty($ids)) {
66+
$collection = $this->_categoryFactory->create()->getCollection();
67+
$collection->addAttributeToSelect('path')
68+
->addAttributeToFilter('entity_id', ['in' => $ids]);
69+
foreach ($collection as $category) {
70+
$this->setExpandedPath($category->getPath());
71+
}
72+
}
6173
return $this;
6274
}
6375

@@ -122,4 +134,73 @@ protected function _getNodeJson($node, $level = 1)
122134
$item['expanded'] = in_array($node->getId(), $this->getExpandedPath());
123135
return $item;
124136
}
137+
138+
/**
139+
* Get tree structure
140+
*
141+
* Ensure that deeply selected categories are present by building the tree
142+
* around selected IDs rather than the default 3-level root-only tree.
143+
*
144+
* @param mixed|null $parenNodeCategory
145+
* @return array
146+
*/
147+
public function getTree($parenNodeCategory = null)
148+
{
149+
// For AJAX child loads, respect the requested parent node
150+
if ($parenNodeCategory !== null) {
151+
$root = $this->getRoot($parenNodeCategory);
152+
} else {
153+
$root = empty($this->_selectedIds)
154+
? $this->getRoot($parenNodeCategory)
155+
: $this->getRootByIds($this->_selectedIds);
156+
}
157+
158+
$rootArray = $this->_getNodeJson($root);
159+
return $rootArray['children'] ?? [];
160+
}
161+
162+
/**
163+
* Get tree json
164+
*
165+
* Ensure that deeply selected categories are present in the JSON output.
166+
*
167+
* @param mixed|null $parenNodeCategory
168+
* @return string
169+
*/
170+
public function getTreeJson($parenNodeCategory = null)
171+
{
172+
// For AJAX child loads, respect the requested parent node
173+
if ($parenNodeCategory !== null) {
174+
$root = $this->getRoot($parenNodeCategory);
175+
} else {
176+
$root = empty($this->_selectedIds)
177+
? $this->getRoot($parenNodeCategory)
178+
: $this->getRootByIds($this->_selectedIds);
179+
}
180+
181+
$rootArray = $this->_getNodeJson($root);
182+
return $this->_jsonEncoder->encode($rootArray['children'] ?? []);
183+
}
184+
185+
/**
186+
* Override parent's implementation to avoid using cached registry root
187+
*
188+
* @param array $ids
189+
* @return \Magento\Framework\Data\Tree\Node|array|null
190+
*/
191+
public function getRootByIds($ids)
192+
{
193+
$ids = $this->_categoryTree->getExistingCategoryIdsBySpecifiedIds($ids);
194+
$tree = $this->_categoryTree->loadByIds($ids);
195+
$rootId = \Magento\Catalog\Model\Category::TREE_ROOT_ID;
196+
$root = $tree->getNodeById($rootId);
197+
if ($root) {
198+
$root->setIsVisible(true);
199+
if ($root->getId() == \Magento\Catalog\Model\Category::TREE_ROOT_ID) {
200+
$root->setName(__('Root'));
201+
}
202+
}
203+
$tree->addCollectionData($this->getCategoryCollection());
204+
return $root;
205+
}
125206
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<arguments>
1313
<argument name="fileName" type="string" defaultValue="magento-logo"/>
1414
</arguments>
15-
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/>
15+
<waitForElementVisible selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="waitForImageInFotorama"/>
16+
<seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeImageInFotorama"/>
1617
</actionGroup>
1718
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection/StorefrontCategorySidebarSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<element name="optionQty" type="text" selector=".filter-options-content .item .count"/>
1616
<element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[data-option-label='{{optionLabel}}']" parameterized="true"/>
1717
<element name="removeFilter" type="button" selector="div.filter-current .remove" timeout="30"/>
18+
<element name="removeAllFilters" type="button" selector="//a[@class='action clear filter-clear']" timeout="30"/>
1819
<element name="activeFilterOptions" type="text" selector=".filter-options-item.active .items"/>
1920
<element name="activeFilterOptionItemByPosition" type="text" selector=".filter-options-item.active .items li:nth-child({{itemPosition}}) a" parameterized="true" timeout="30"/>
2021
<element name="enabledFilterOptionItemByLabel" type="text" selector="//div[contains(@class, 'filter-options')]//li[@class='item']//a[contains(text(), '{{optionLabel}}')]" parameterized="true" timeout="30"/>

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
</actionGroup>
108108
<!-- Add images for ChildProduct1 -->
109109
<actionGroup ref="AddProductImageActionGroup" stepKey="addChildProduct1ProductImage">
110-
<argument name="image" value="TestImageNew"/>
110+
<argument name="image" value="ProductImage"/>
111111
</actionGroup>
112112
<actionGroup ref="AddProductImageActionGroup" stepKey="addChildProduct1Magento2">
113113
<argument name="image" value="Magento2"/>
@@ -127,8 +127,8 @@
127127
<argument name="storeViewName" value="'Default Store View'"/>
128128
</actionGroup>
129129
<!-- Add image for ChildProduct2 -->
130-
<actionGroup ref="AddProductImageActionGroup" stepKey="addChildProduct2TestImageNew">
131-
<argument name="image" value="TestImageNew"/>
130+
<actionGroup ref="AddProductImageActionGroup" stepKey="addChildProduct2ProductImage">
131+
<argument name="image" value="ProductImage"/>
132132
</actionGroup>
133133
<!-- Save changes fot ChildProduct2 -->
134134
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveChildProduct2Product"/>
@@ -161,16 +161,18 @@
161161
<argument name="attributeLabel" value="$$createConfigProductAttribute.default_frontend_label$$"/>
162162
<argument name="optionLabel" value="$$getConfigAttributeOption1.label$$"/>
163163
</actionGroup>
164+
<waitForAjaxLoad stepKey="waitForAjaxLoadForOption1"/>
165+
<waitForElementNotVisible selector="{{StorefrontProductMediaSection.gallerySpinner}}" stepKey="waitForGallerySpinnerDisappearForOption1"/>
164166
<!-- Check fotorama thumbnail images (first option selected) -->
167+
<actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeProductImageForFirstOption">
168+
<argument name="fileName" value="{{ProductImage.filename}}"/>
169+
</actionGroup>
165170
<actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeMagento3ForFirstOption">
166171
<argument name="fileName" value="{{Magento3.filename}}"/>
167172
</actionGroup>
168173
<actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeTestImageAdobeForFirstOption">
169174
<argument name="fileName" value="{{TestImageAdobe.filename}}"/>
170175
</actionGroup>
171-
<actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeProductImageForFirstOption">
172-
<argument name="fileName" value="{{TestImageNew.filename}}"/>
173-
</actionGroup>
174176
<!-- Check active fotorama thumbnail image (first option selected) -->
175177
<actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="seeActiveMagento2ForFirstOption">
176178
<argument name="fileName" value="{{Magento2.filename}}"/>
@@ -180,6 +182,8 @@
180182
<argument name="attributeLabel" value="$$createConfigProductAttribute.default_frontend_label$$"/>
181183
<argument name="optionLabel" value="$$getConfigAttributeOption2.label$$"/>
182184
</actionGroup>
185+
<waitForAjaxLoad stepKey="waitForAjaxLoadForOption2"/>
186+
<waitForElementNotVisible selector="{{StorefrontProductMediaSection.gallerySpinner}}" stepKey="waitForGallerySpinnerDisappearForOption2"/>
183187
<!-- Check fotorama thumbnail images (second option selected) -->
184188
<actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeMagento3ForSecondOption">
185189
<argument name="fileName" value="{{Magento3.filename}}"/>
@@ -188,8 +192,8 @@
188192
<argument name="fileName" value="{{TestImageAdobe.filename}}"/>
189193
</actionGroup>
190194
<!-- Check active fotorama thumbnail image (second option selected) -->
191-
<actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="seeActiveTestImageNewForSecondOption">
192-
<argument name="fileName" value="{{TestImageNew.filename}}"/>
195+
<actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="seeActiveProductImageForSecondOption">
196+
<argument name="fileName" value="{{ProductImage.filename}}"/>
193197
</actionGroup>
194198
</test>
195199
</tests>

0 commit comments

Comments
 (0)