Skip to content

Commit ff45efa

Browse files
authored
Merge branch '2.4-develop' into 2.4-develop-system_file-xsd-fix
2 parents 34c854a + edee5b1 commit ff45efa

File tree

203 files changed

+8221
-2490
lines changed

Some content is hidden

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

203 files changed

+8221
-2490
lines changed

.github/app-projects-boards-automation.config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2025 Adobe
2+
# All Rights Reserved.
3+
14
automations:
25

36
############################################################################################################
@@ -401,3 +404,10 @@ automations:
401404
]
402405
actions:
403406
- addLabelsToRelated: ['${modifiedLabel.name}']
407+
408+
- trigger: issues.closed
409+
actions:
410+
- removeFromProject: [18]
411+
- removeFromProject: [21]
412+
- removeFromProject: [20]
413+
- removeFromProject: [19]

app/code/Magento/AwsS3/Driver/AwsS3.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ private function createDirectoryRecursively(string $path): bool
188188
$parentDir = dirname($path);
189189

190190
while (!$this->isDirectory($parentDir)) {
191-
$this->createDirectoryRecursively($parentDir);
191+
if (!$this->createDirectoryRecursively($parentDir)) {
192+
return false;
193+
}
192194
}
193195

194196
if (!$this->isDirectory($path)) {

app/code/Magento/AwsS3/Test/Unit/Driver/AwsS3Test.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
/**
2020
* @see AwsS3
21+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2122
*/
2223
class AwsS3Test extends TestCase
2324
{
@@ -497,6 +498,23 @@ public function testCreateDirectory(): void
497498
self::assertTrue($this->driver->createDirectory(self::URL . 'test/test2/'));
498499
}
499500

501+
/**
502+
* This test ensures that the method does not loop infinitely in case of an exception
503+
*
504+
* @return void
505+
* @throws FileSystemException
506+
* @throws \PHPUnit\Framework\MockObject\Exception
507+
*/
508+
public function testShouldFailSafelyIfUnableToCreateDirectory(): void
509+
{
510+
$this->adapterMock->expects(self::once())
511+
->method('createDirectory')
512+
->willThrowException($this->createMock(\League\Flysystem\FilesystemException::class))
513+
->with('test');
514+
515+
self::assertFalse($this->driver->createDirectory(self::URL . 'test/test2/'));
516+
}
517+
500518
public function testRename(): void
501519
{
502520
$this->adapterMock->expects(self::once())

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,15 @@ public function getCurrentSelectionName()
457457
if ($this->getCurrentWebsiteName() !== '') {
458458
return $this->getCurrentWebsiteName();
459459
}
460+
461+
if (!$this->hasDefaultOption()) {
462+
$websites = $this->getWebsites();
463+
if (!empty($websites)) {
464+
$websiteArray = array_values($websites);
465+
return $websiteArray[0]->getName();
466+
}
467+
}
468+
460469
return $this->getDefaultSelectionName();
461470
}
462471

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 2025 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="AdminDisableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin disables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminDisableReportConfigData.path}} {{AdminDisableReportConfigData.value}}" stepKey="setReportAsDisable"/>
16+
</actionGroup>
17+
</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 2025 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="AdminEnableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin enables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminEnableReportConfigData.path}} {{AdminEnableReportConfigData.value}}" stepKey="setReportAsEnable"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminMenuData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<data key="pageTitle">Dashboard</data>
2323
<data key="title">Dashboard</data>
2424
<data key="dataUiId">magento-backend-dashboard</data>
25+
<data key="message">Chart is disabled</data>
2526
</entity>
2627
<entity name="AdminMenuStores">
2728
<data key="pageTitle">Stores</data>

app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616
<data key="path">web/seo/use_rewrites</data>
1717
<data key="value">0</data>
1818
</entity>
19+
<entity name="AdminEnableReportConfigData">
20+
<data key="path">reports/options/enabled</data>
21+
<data key="value">1</data>
22+
</entity>
23+
<entity name="AdminDisableReportConfigData">
24+
<data key="path">reports/options/enabled</data>
25+
<data key="value">0</data>
26+
</entity>
1927
</entities>

app/code/Magento/Backend/Test/Mftf/Section/AdminDashboardSection.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@
1919
<element name="dashboardTotals" type="text" selector="//*[@class='dashboard-totals-label' and contains(text(), '{{columnName}}')]/../*[@class='dashboard-totals-value']" parameterized="true"/>
2020
<element name="productInBestsellers" type="text" selector="#productsOrderedGrid_table td.col-product.col-name"/>
2121
<element name="dashboardButtonReloadData" type="button" selector=".action-primary[title='Reload Data'][type='submit']"/>
22+
<element name="productTab" type="button" selector="//*[@class='data-grid-th no-link col-name']" timeout="30"/>
23+
<element name="priceTab" type="button" selector="//*[@class='data-grid-th no-link col-price']" timeout="30"/>
24+
<element name="viewsTab" type="button" selector="//*[@class='data-grid-th col-views no-link col-views']" timeout="30"/>
25+
<element name="productName" type="text" selector="//td[contains(text(), '{{columnName}}')]" parameterized="true"/>
26+
<element name="productPrice" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-price a-right ')]" parameterized="true"/>
27+
<element name="productViews" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-views col-views last')]" parameterized="true"/>
28+
<element name="mostViewProductsTab" type="button" selector="//*[contains(@class, 'ui-state-default ui-corner-top') and contains(@aria-labelledby, 'grid_tab_reviewed_products')]" timeout="30"/>
29+
<element name="dashboardChart" type="text" selector="//*[@class='dashboard-diagram-disabled' and contains(text(), '{{columnName}}')]" parameterized="true"/>
2230
</section>
2331
</sections>
32+

app/code/Magento/Bundle/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Bundle.php

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
use Magento\Bundle\Api\Data\OptionInterfaceFactory as OptionFactory;
99
use Magento\Bundle\Api\Data\LinkInterfaceFactory as LinkFactory;
1010
use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory;
11+
use Magento\Catalog\Api\Data\ProductInterface;
1112
use Magento\Catalog\Api\ProductRepositoryInterface as ProductRepository;
1213
use Magento\Store\Model\StoreManagerInterface as StoreManager;
1314
use Magento\Framework\App\RequestInterface;
1415

1516
/**
16-
* Class Bundle
17+
* Plugin class to initialize Bundle product
18+
*
1719
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1820
*/
1921
class Bundle
@@ -106,12 +108,14 @@ public function afterInitialize(
106108
$product->setBundleOptionsData($result['bundle_options']);
107109
}
108110

111+
if (!$result['bundle_selections']) {
112+
$this->resetBundleProductOptions($product);
113+
}
114+
109115
$this->processBundleOptionsData($product);
110116
$this->processDynamicOptionsData($product);
111117
} elseif (!$compositeReadonly) {
112-
$extension = $product->getExtensionAttributes();
113-
$extension->setBundleProductOptions([]);
114-
$product->setExtensionAttributes($extension);
118+
$this->resetBundleProductOptions($product);
115119
}
116120

117121
$affectProductSelections = (bool)$this->request->getPost('affect_bundle_product_selections');
@@ -120,6 +124,8 @@ public function afterInitialize(
120124
}
121125

122126
/**
127+
* Process Bundle Options Data
128+
*
123129
* @param \Magento\Catalog\Model\Product $product
124130
* @return void
125131
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -161,10 +167,11 @@ protected function processBundleOptionsData(\Magento\Catalog\Model\Product $prod
161167
$extension = $product->getExtensionAttributes();
162168
$extension->setBundleProductOptions($options);
163169
$product->setExtensionAttributes($extension);
164-
return;
165170
}
166171

167172
/**
173+
* Process Dynamic Options Data
174+
*
168175
* @param \Magento\Catalog\Model\Product $product
169176
* @return void
170177
*/
@@ -198,9 +205,10 @@ protected function processDynamicOptionsData(\Magento\Catalog\Model\Product $pro
198205
}
199206

200207
/**
208+
* Build product link
209+
*
201210
* @param \Magento\Catalog\Model\Product $product
202211
* @param array $linkData
203-
*
204212
* @return \Magento\Bundle\Api\Data\LinkInterface
205213
*/
206214
private function buildLink(
@@ -228,4 +236,18 @@ private function buildLink(
228236

229237
return $link;
230238
}
239+
240+
/**
241+
* Resets bundle product options inside product extension attributes
242+
*
243+
* @param ProductInterface $product
244+
* @return void
245+
*/
246+
private function resetBundleProductOptions(ProductInterface $product) : void
247+
{
248+
$extension = $product->getExtensionAttributes();
249+
$extension->setBundleProductOptions([]);
250+
$product->setExtensionAttributes($extension);
251+
$product->setDropOptions(true);
252+
}
231253
}

0 commit comments

Comments
 (0)