Skip to content

Commit 30e817b

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACP2E-3774
2 parents 45a88d3 + 27217d0 commit 30e817b

File tree

194 files changed

+7137
-1817
lines changed

Some content is hidden

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

194 files changed

+7137
-1817
lines changed

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

Lines changed: 402 additions & 0 deletions
Large diffs are not rendered by default.

app/code/Magento/Backend/App/Area/FrontNameResolver.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ public function getFrontName($checkHost = false)
117117
/**
118118
* Return whether the host from request is the backend host
119119
*
120+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
121+
* @SuppressWarnings(PHPMD.NPathComplexity)
122+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
120123
* @return bool
121124
*/
122125
public function isHostBackend()
@@ -128,10 +131,11 @@ public function isHostBackend()
128131
if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) {
129132
$backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE);
130133
} else {
131-
$backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL);
134+
$xmlPath = $this->request->isSecure() ? Store::XML_PATH_SECURE_BASE_URL : Store::XML_PATH_UNSECURE_BASE_URL;
135+
$backendUrl = $this->config->getValue($xmlPath);
132136
if ($backendUrl === null) {
133137
$backendUrl = $this->scopeConfig->getValue(
134-
Store::XML_PATH_UNSECURE_BASE_URL,
138+
$xmlPath,
135139
ScopeInterface::SCOPE_STORE
136140
);
137141
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/**
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Backend\Cron;
9+
10+
use Magento\Framework\Lock\Backend\FileLock;
11+
use Magento\Framework\Lock\LockBackendFactory;
12+
use Psr\Log\LoggerInterface;
13+
14+
class CleanLocks
15+
{
16+
/**
17+
* @param LockBackendFactory $lockFactory
18+
* @param LoggerInterface $logger
19+
*/
20+
public function __construct(
21+
private readonly LockBackendFactory $lockFactory,
22+
private readonly LoggerInterface $logger,
23+
) {
24+
}
25+
26+
/**
27+
* Cron job to cleanup old locks
28+
*/
29+
public function execute(): void
30+
{
31+
$locker = $this->lockFactory->create();
32+
33+
if ($locker instanceof FileLock) {
34+
$numberOfLockFilesDeleted = $locker->cleanupOldLocks();
35+
36+
$this->logger->info(sprintf('Deleted %d old lock files', $numberOfLockFilesDeleted));
37+
}
38+
}
39+
}

app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public function testIsHostBackend(
129129
->willReturnMap(
130130
[
131131
[Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE, null, $url],
132+
[Store::XML_PATH_SECURE_BASE_URL, ScopeInterface::SCOPE_STORE, null, $url],
132133
[
133134
FrontNameResolver::XML_PATH_USE_CUSTOM_ADMIN_URL,
134135
ScopeInterface::SCOPE_STORE,
@@ -160,7 +161,6 @@ public function testIsHostBackend(
160161
->setHost(parse_url($url, PHP_URL_HOST))
161162
->setPort(parse_url($url, PHP_URL_PORT))
162163
);
163-
164164
$this->assertEquals($expectedValue, $this->model->isHostBackend());
165165
}
166166

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?xml version="1.0"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2015 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
99
<group id="default">
1010
<job name="backend_clean_cache" instance="Magento\Backend\Cron\CleanCache" method="execute">
1111
<schedule>30 2 * * *</schedule>
1212
</job>
13+
<job name="backend_clean_locks" instance="Magento\Backend\Cron\CleanLocks" method="execute">
14+
<schedule>20 2 * * *</schedule>
15+
</job>
1316
</group>
1417
</config>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundleProductActionSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
4+
* Copyright 2025 Adobe
55
* All Rights Reserved.
66
*/
77
-->
@@ -14,6 +14,6 @@
1414
<element name="dropdownSelectOption" type="select" selector="//div[@class='control']/select"/>
1515
<element name="dropdownProductSelection" type="select" selector="//div[@class='control']/select/option[contains(.,'{{productName}}')]" parameterized="true"/>
1616
<element name="customOptionField" type="select" selector="[class='input-text product-custom-option']"/>
17-
<element name="bundleOption" type="text" selector="//*[@id='product-options-wrapper']//div[@class='control']//span[text()='{{productName}}']" parameterized="true"/>
17+
<element name="bundleOption" type="text" selector="//select[contains(@class, 'bundle-option')]/option[contains(text(),'{{productName}}')]" parameterized="true"/>
1818
</section>
1919
</sections>

app/code/Magento/CacheInvalidate/Test/Mftf/Test/AdminValidateEAVTypesAndAttributesConfigurationTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<description value="Validate EAVTypes And Attributes Cache Type After Cache Management"/>
1616
<severity value="MAJOR"/>
1717
<testCaseId value="AC-3833"/>
18+
<!-- pr exclude group is added as test case failing because of entity not found and will be fixed and removed in ACQE-7691 -->
19+
<group value="pr_exclude"/>
1820
</annotations>
1921
<before>
2022
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright 2024 Adobe
54
* All Rights Reserved.
65
*/
@@ -272,6 +271,16 @@ public function execute()
272271
if (array_key_exists('reset_is-default_option', $data) && $data['reset_is-default_option']) {
273272
unset($data['reset_is-default_option']);
274273
$data['default_value'] = null;
274+
} elseif (isset($data['default'])) {
275+
$defaultOptions = [];
276+
foreach ($data['default'] as $defaultValue) {
277+
if ((int)$defaultValue > 0) {
278+
$defaultOptions[] = $defaultValue;
279+
}
280+
}
281+
if (!empty($defaultOptions)) {
282+
$data['default_value'] = implode(",", $defaultOptions);
283+
}
275284
}
276285

277286
$model->addData($data);

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,9 @@ public function addMediaGalleryData()
23622362
return $this;
23632363
}
23642364

2365-
if (!$this->getSize()) {
2365+
$size = $this->isLoaded() ? $this->count() : $this->getSize();
2366+
2367+
if (!$size) {
23662368
return $this;
23672369
}
23682370

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -19,7 +19,7 @@
1919
<element name="secondOptionStoreView" type="input" selector="//td[@class='col-option_1'][3]/input"/>
2020
<element name="customStoreViewField" type="input" selector="input[value='{{fieldValue}}']" parameterized="true"/>
2121
<element name="adminOption" type="input" selector="//input[contains(@name,'option[value][option_{{row}}][0]')]" parameterized="true"/>
22-
<element name="defaultRadioButton" type="radio" selector="//tr[{{row}}]//input[contains(@name,'default[]')]" parameterized="true"/>
22+
<element name="defaultRadioButton" type="radio" selector="//tr[{{row}}]//input[contains(@name,'default[')]" parameterized="true"/>
2323
<element name="isRequired" type="checkbox" selector="//input[contains(@name,'is_required')]/..//label"/>
2424
<element name="advancedAttributeProperties" type="text" selector="//div[contains(@data-index,'advanced_fieldset')]"/>
2525
<element name="attributeCode" type="input" selector="//*[@class='admin__fieldset-wrapper-content admin__collapsible-content _show']//input[@name='attribute_code']"/>

0 commit comments

Comments
 (0)