Skip to content

Commit 0e58811

Browse files
Merge branch '2.4-develop' into patch-1
2 parents 4b007c2 + 661c15c commit 0e58811

File tree

451 files changed

+13164
-4209
lines changed

Some content is hidden

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

451 files changed

+13164
-4209
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Export/AdvancedPricing.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ private function fetchTierPrices(array $productIds): array
486486
)
487487
->where(
488488
'ap.' . $productEntityLinkField . ' IN (?)',
489-
$productIds
489+
$productIds,
490+
\Zend_Db::INT_TYPE
490491
);
491492

492493
if ($priceFromFilter !== null) {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ public function isHostBackend()
123123
if ($this->scopeConfig->getValue(self::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE)) {
124124
$backendUrl = $this->scopeConfig->getValue(self::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE);
125125
} else {
126-
$backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
126+
$backendUrl = $this->config->getValue(Store::XML_PATH_UNSECURE_BASE_URL);
127+
if ($backendUrl === null) {
128+
$backendUrl = $this->scopeConfig->getValue(
129+
Store::XML_PATH_UNSECURE_BASE_URL,
130+
ScopeInterface::SCOPE_STORE
131+
);
132+
}
127133
}
128134
$host = $this->request->getServer('HTTP_HOST', '');
129135
return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false;

app/code/Magento/Backend/Block/Widget/Button.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
namespace Magento\Backend\Block\Widget;
77

8+
use Magento\Backend\Block\Template\Context;
89
use Magento\Framework\App\ObjectManager;
910
use Magento\Framework\Math\Random;
10-
use Magento\Backend\Block\Template\Context;
1111
use Magento\Framework\View\Helper\SecureHtmlRenderer;
1212

1313
/**
@@ -125,6 +125,9 @@ protected function _prepareAttributes($title, $classes, $disabled)
125125
'value' => $this->getValue(),
126126
'disabled' => $disabled,
127127
];
128+
if ($this->hasData('onclick_attribute')) {
129+
$attributes['onclick'] = $this->getData('onclick_attribute');
130+
}
128131
if ($this->hasData('backend_button_widget_hook_id')) {
129132
$attributes['backend-button-widget-hook-id'] = $this->getData('backend_button_widget_hook_id');
130133
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AssertLinkActionGroup">
12+
<annotations>
13+
<description>Assert text and url of the links.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="text" type="string"/>
17+
<argument name="url" type="string"/>
18+
</arguments>
19+
20+
<seeLink userInput="{{text}}" url="{{url}}" stepKey="assertLinks"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<after>
2323
<!-- 6. Restore default configuration settings. -->
2424
<magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/>
25+
<!-- Customer Log Out -->
26+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
2527
<!-- Delete data -->
2628
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
2729
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminPrivacyPolicyTest.xml

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,70 +23,91 @@
2323
<!-- Logging in Magento admin and checking for Privacy policy footer in dashboard -->
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2525
<closeAdminNotification stepKey="closeAdminNotification"/>
26-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkDashboard"/>
27-
26+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkDashboard">
27+
<argument name="text" value="Privacy Policy"/>
28+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
29+
</actionGroup>
2830
<!-- Checking for Privacy policy footer in salesOrderPage -->
2931
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSalesOrder">
3032
<argument name="menuUiId" value="magento-sales-sales"/>
3133
<argument name="submenuUiId" value="magento-sales-sales-order"/>
3234
</actionGroup>
33-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSalesOrder"/>
34-
35+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSalesOrder">
36+
<argument name="text" value="Privacy Policy"/>
37+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
38+
</actionGroup>
3539
<!-- Checking for Privacy policy footer in catalogProductsPage -->
3640
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCatalogProducts">
3741
<argument name="menuUiId" value="magento-catalog-catalog"/>
3842
<argument name="submenuUiId" value="magento-catalog-catalog-products"/>
3943
</actionGroup>
40-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCatalogProducts"/>
41-
44+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCatalogProducts">
45+
<argument name="text" value="Privacy Policy"/>
46+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
47+
</actionGroup>
4248
<!-- Checking for Privacy policy footer in customersAllCustomersPage -->
4349
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToCustomersAllCustomers">
4450
<argument name="menuUiId" value="magento-customer-customer"/>
4551
<argument name="submenuUiId" value="magento-customer-customer-manage"/>
4652
</actionGroup>
47-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkCustomersAllCustomers"/>
48-
53+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkCustomersAllCustomers">
54+
<argument name="text" value="Privacy Policy"/>
55+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
56+
</actionGroup>
4957
<!-- Checking for Privacy policy footer in marketingCatalogPriceRulePage -->
5058
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToMarketingCatalogPriceRule">
5159
<argument name="menuUiId" value="magento-backend-marketing"/>
5260
<argument name="submenuUiId" value="magento-catalogrule-promo-catalog"/>
5361
</actionGroup>
54-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule"/>
55-
62+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkMarketingCatalogPriceRule">
63+
<argument name="text" value="Privacy Policy"/>
64+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
65+
</actionGroup>
5666
<!-- Checking for Privacy policy footer in contentBlocksPage -->
5767
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentBlocks">
5868
<argument name="menuUiId" value="magento-backend-content"/>
5969
<argument name="submenuUiId" value="magento-cms-cms-block"/>
6070
</actionGroup>
61-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkContentBlocks"/>
62-
71+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkContentBlocks">
72+
<argument name="text" value="Privacy Policy"/>
73+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
74+
</actionGroup>
6375
<!-- Checking for Privacy policy footer in reportSearcbTermsPage -->
6476
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToReportsSearchTerms">
6577
<argument name="menuUiId" value="magento-reports-report"/>
6678
<argument name="submenuUiId" value="magento-search-report-search-term"/>
6779
</actionGroup>
68-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkReportsSearchTerms"/>
69-
80+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkReportsSearchTerms">
81+
<argument name="text" value="Privacy Policy"/>
82+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
83+
</actionGroup>
7084
<!-- Checking for Privacy policy footer in storesAllStoresPage -->
7185
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToStoresAllStores">
7286
<argument name="menuUiId" value="magento-backend-stores"/>
7387
<argument name="submenuUiId" value="magento-backend-system-store"/>
7488
</actionGroup>
75-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkStoresAllStores"/>
76-
89+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkStoresAllStores">
90+
<argument name="text" value="Privacy Policy"/>
91+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
92+
</actionGroup>
7793
<!-- Checking for Privacy policy footer in systemImportPage -->
7894
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemImport">
7995
<argument name="menuUiId" value="magento-backend-system"/>
8096
<argument name="submenuUiId" value="magento-importexport-system-convert-import"/>
8197
</actionGroup>
82-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkSystemImport"/>
83-
98+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkSystemImport">
99+
<argument name="text" value="Privacy Policy"/>
100+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
101+
</actionGroup>
84102
<!-- Checking for Privacy policy footer in findPartnersAndExtensionsPage -->
85103
<actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToFindPartnersAndExtensions">
86104
<argument name="menuUiId" value="magento-marketplace-partners"/>
87105
<argument name="submenuUiId" value="magento-marketplace-partners"/>
88106
</actionGroup>
89-
<seeLink userInput="Privacy Policy" url="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions"/>
107+
<actionGroup ref="AssertLinkActionGroup" stepKey="seePrivacyPolicyLinkFindPartnersAndExtensions">
108+
<argument name="text" value="Privacy Policy"/>
109+
<argument name="url" value="https://magento.com/sites/default/files/REVISED-MAGENTO-PRIVACY-POLICY.pdf"/>
110+
</actionGroup>
90111
</test>
91112
</tests>
92113

app/code/Magento/Backend/Test/Unit/Block/Widget/ButtonTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,16 @@ public function getAttributesHtmlDataProvider()
9494
]
9595
];
9696
}
97+
98+
/**
99+
* Verifies ability of adding button onclick attribute
100+
*
101+
* @return void
102+
*/
103+
public function testOnClickAttribute(): void
104+
{
105+
$this->_blockMock->setData(['onclick_attribute' => 'value']);
106+
$attributes = $this->_blockMock->getAttributesHtml();
107+
$this->assertStringContainsString('onclick', $attributes);
108+
}
97109
}

app/code/Magento/Bundle/Model/ResourceModel/Selection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ public function getParentIdsByChild($childId)
145145
['e.entity_id as parent_product_id']
146146
)->where(
147147
$this->getMainTable() . '.product_id IN(?)',
148-
$childId
148+
$childId,
149+
\Zend_Db::INT_TYPE
149150
);
150151

151152
return $connection->fetchCol($select);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
<requiredEntity createDataKey="createSimpleProduct"/>
4343
</createData>
4444

45-
<!-- Reindex -->
46-
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
47-
<argument name="indices" value=""/>
48-
</actionGroup>
45+
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
4946

5047
<!-- Login as admin -->
5148
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
<requiredEntity createDataKey="createSimpleProduct"/>
3737
</createData>
3838
<!-- TODO: Remove this action when MC-37719 will be fixed -->
39-
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
40-
<argument name="indices" value="cataloginventory_stock"/>
41-
</actionGroup>
39+
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindexInvalidatedIndices"/>
4240
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
4341
</before>
4442
<after>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@
133133
<click selector="{{AdminProductFiltersSection.enable}}" stepKey="ClickOnEnable"/>
134134

135135
<!--Clear Cache - reindex - resets products according to enabled/disabled view-->
136-
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
137-
<argument name="indices" value=""/>
138-
</actionGroup>
136+
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
139137
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
140138
<argument name="tags" value=""/>
141139
</actionGroup>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<requiredEntity createDataKey="apiSimple"/>
4242
</createData>
4343
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
44-
<argument name="indices" value=""/>
44+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
4545
</actionGroup>
4646
</before>
4747
<after>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@
4848
<argument name="productId" value="$createFixedBundleProduct.id$"/>
4949
</actionGroup>
5050
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
51-
<!--Perform reindex and flush cache-->
52-
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
51+
<comment userInput="Adding the comment to replace AdminReindexAndFlushCache action group ('indexer:reindex', 'cache:flush' commands) for preserving Backward Compatibility" stepKey="reindexAndFlushCache"/>
5352
</before>
5453
<after>
5554
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProductForBundleItem"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
<requiredEntity createDataKey="fixedBundleOption"/>
4040
<requiredEntity createDataKey="createSimpleProductTwo"/>
4141
</createData>
42+
4243
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
43-
<argument name="indices" value=""/>
44+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
4445
</actionGroup>
4546
</before>
4647
<after>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696

9797
<!-- Perform CLI reindex -->
9898
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
99-
<argument name="indices" value=""/>
99+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
100100
</actionGroup>
101101
</before>
102102
<after>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<see userInput="You saved the configuration." selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccess"/>
169169

170170
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
171-
<argument name="indices" value=""/>
171+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
172172
</actionGroup>
173173
</before>
174174
<after>

app/code/Magento/BundleImportExport/Test/Mftf/Test/UpdateBundleProductViaImportTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<argument name="tags" value="full_page"/>
4343
</actionGroup>
4444
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterCreate">
45-
<argument name="indices" value=""/>
45+
<argument name="indices" value="catalog_product_price"/>
4646
</actionGroup>
4747

4848
<!-- Check Bundle product is visible on the storefront-->
@@ -63,9 +63,7 @@
6363
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCacheAfterUpdate">
6464
<argument name="tags" value="full_page"/>
6565
</actionGroup>
66-
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="indexerReindexAfterUpdate">
67-
<argument name="indices" value=""/>
68-
</actionGroup>
66+
<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="indexerReindexAfterUpdate"/>
6967

7068
<!-- Check Bundle product is still visible on the storefront-->
7169
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPageAfterUpdate">

app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,22 @@ public function getImagesJson()
209209
*/
210210
private function sortImagesByPosition($images)
211211
{
212-
if (is_array($images)) {
212+
$nullPositions = [];
213+
foreach ($images as $index => $image) {
214+
if ($image['position'] === null) {
215+
$nullPositions[] = $image;
216+
unset($images[$index]);
217+
}
218+
}
219+
if (is_array($images) && !empty($images)) {
213220
usort(
214221
$images,
215222
function ($imageA, $imageB) {
216223
return ($imageA['position'] < $imageB['position']) ? -1 : 1;
217224
}
218225
);
219226
}
220-
return $images;
227+
return array_merge($images, $nullPositions);
221228
}
222229

223230
/**

0 commit comments

Comments
 (0)