Skip to content

Commit 41315c6

Browse files
merge magento/2.4.0-develop into magento-tsg/2.4.0-develop-pr58
2 parents eafd16d + e10e680 commit 41315c6

File tree

13 files changed

+307
-160
lines changed

13 files changed

+307
-160
lines changed

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,9 @@ protected function _initCategory()
205205
/**
206206
* Category view action
207207
*
208-
* @return ResultInterface
209208
* @throws NoSuchEntityException
210209
*/
211-
public function execute(): ?ResultInterface
210+
public function execute()
212211
{
213212
$result = null;
214213

app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
define([
7-
'Magento_Customer/js/customer-data'
8-
], function (customerData) {
6+
define(['Magento_Customer/js/customer-data'], function (customerData) {
97
'use strict';
108

11-
var cartData = customerData.get('cart');
9+
return function () {
10+
var cartData = customerData.get('cart');
1211

13-
if (cartData().items && cartData().items.length !== 0) {
14-
customerData.reload(['cart'], false);
15-
}
12+
customerData.getInitCustomerData().done(function () {
13+
if (cartData().items && cartData().items.length !== 0) {
14+
customerData.reload(['cart'], false);
15+
}
16+
});
17+
};
1618
});

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ define([
2424
invalidateCacheByCloseCookieSession,
2525
dataProvider,
2626
buffer,
27-
customerData;
27+
customerData,
28+
deferred = $.Deferred();
2829

2930
url.setBaseUrl(window.BASE_URL);
3031
options.sectionLoadUrl = url.build('customer/section/load');
@@ -341,6 +342,15 @@ define([
341342
$.cookieStorage.set('section_data_ids', sectionDataIds);
342343
},
343344

345+
/**
346+
* Checks if customer data is initialized.
347+
*
348+
* @returns {jQuery.Deferred}
349+
*/
350+
getInitCustomerData: function () {
351+
return deferred.promise();
352+
},
353+
344354
/**
345355
* @param {Object} settings
346356
* @constructor
@@ -350,6 +360,7 @@ define([
350360
invalidateCacheBySessionTimeOut(settings);
351361
invalidateCacheByCloseCookieSession();
352362
customerData.init();
363+
deferred.resolve();
353364
}
354365
};
355366

app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<argument name="link" value="downloadableLink"/>
3838
<argument name="index" value="0"/>
3939
</actionGroup>
40-
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" />
40+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToAllowlist" after="addDownloadableProductLinkAgain" />
4141
<scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/>
4242
<click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/>
4343
<see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/>

app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
?>
1717
<form id="checkout_multishipping_form"
1818
data-mage-init='{
19-
"multiShipping":{},
19+
"multiShipping": {"itemsQty": <?= /* @noEscape */ (int)$block->getCheckout()->getQuote()->getItemsSummaryQty() ?>},
2020
"cartUpdate": {
2121
"validationURL": "<?= $block->escapeUrl($block->getUrl('multishipping/checkout/checkItems')) ?>",
2222
"eventName": "updateMulticartItemQty"

app/code/Magento/Multishipping/view/frontend/web/js/multi-shipping.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
define([
77
'jquery',
8+
'Magento_Customer/js/customer-data',
89
'jquery-ui-modules/widget'
9-
], function ($) {
10+
], function ($, customerData) {
1011
'use strict';
1112

1213
$.widget('mage.multiShipping', {
1314
options: {
15+
itemsQty: 0,
1416
addNewAddressBtn: 'button[data-role="add-new-address"]', // Add a new multishipping address.
1517
addNewAddressFlag: '#add_new_address_flag', // Hidden input field with value 0 or 1.
1618
canContinueBtn: 'button[data-role="can-continue"]', // Continue (update quantity or go to shipping).
@@ -22,10 +24,24 @@ define([
2224
* @private
2325
*/
2426
_create: function () {
27+
this._prepareCartData();
2528
$(this.options.addNewAddressBtn).on('click', $.proxy(this._addNewAddress, this));
2629
$(this.options.canContinueBtn).on('click', $.proxy(this._canContinue, this));
2730
},
2831

32+
/**
33+
* Takes cart items qty from current cart data and compare it with current items qty
34+
* Reloads cart data if cart items qty is wrong
35+
* @private
36+
*/
37+
_prepareCartData: function () {
38+
var cartData = customerData.get('cart');
39+
40+
if (cartData()['summary_count'] !== this.options.itemsQty) {
41+
customerData.reload(['cart'], false);
42+
}
43+
},
44+
2945
/**
3046
* Add a new address. Set the hidden input field and submit the form. Then enter a new shipping address.
3147
* @private

app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup">
1111
<arguments>
12-
<argument name="payerName" defaultValue="MPI" type="string"/>
1312
<argument name="credentials" defaultValue="_CREDS"/>
1413
</arguments>
1514
<!--Check in-context-->

app/code/Magento/Paypal/Test/Mftf/ActionGroup/StorefrontLoginToPayPalPaymentFromCartActionGroup.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="StorefrontLoginToPayPalPaymentFromCartAccountActionGroup" extends="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup">
11+
<arguments>
12+
<argument name="payerName" defaultValue="MPI" type="string"/>
13+
</arguments>
1114
<seeElement selector="{{PayPalCheckoutAsGuestSection.CreditDebitBtn}}" stepKey="assertCheckoutAsGuest" before="waitForLoginForm"/>
12-
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.userName}}" stepKey="seePayerName"/>
15+
<see userInput="{{payerName}}" selector="{{PayPalPaymentSection.userName}}" stepKey="seePayerName" after="assertCheckoutAsGuest"/>
1316
</actionGroup>
1417
</actionGroups>

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInProductPageTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@
7979
<actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/>
8080

8181
<!--Login to Paypal in-context-->
82-
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal">
83-
<argument name="payerName" value="{{Payer.firstName}}"/>
84-
</actionGroup>
82+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal"/>
83+
8584
<!--Transfer Cart Line and Shipping Method assertion-->
8685
<actionGroup ref="PayPalAssertTransferLineAndShippingMethodNotExistActionGroup" stepKey="assertPayPalSettings"/>
8786

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"laminas/laminas-uri": "^2.5.1",
6565
"laminas/laminas-validator": "^2.6.0",
6666
"laminas/laminas-view": "~2.11.2",
67-
"magento/composer": "1.6.x-dev",
67+
"magento/composer": "1.6.0",
6868
"magento/magento-composer-installer": ">=0.1.11",
6969
"magento/zendframework1": "~1.14.2",
7070
"monolog/monolog": "^1.17",
@@ -88,7 +88,7 @@
8888
"friendsofphp/php-cs-fixer": "~2.16.0",
8989
"lusitanian/oauth": "~0.8.10",
9090
"magento/magento-coding-standard": "*",
91-
"magento/magento2-functional-testing-framework": "3.0.0-RC4",
91+
"magento/magento2-functional-testing-framework": "3.0.0-RC5",
9292
"pdepend/pdepend": "~2.7.1",
9393
"phpcompatibility/php-compatibility": "^9.3",
9494
"phpmd/phpmd": "^2.8.0",

0 commit comments

Comments
 (0)