Skip to content

Commit b7e6429

Browse files
authored
Merge branch '2.4-develop' into fix-30094
2 parents 40df5c8 + c03bde6 commit b7e6429

File tree

54 files changed

+1634
-196
lines changed

Some content is hidden

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

54 files changed

+1634
-196
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontCheckPresentSubCategoryActionGroup">
11+
<annotations>
12+
<description>Checks for a subcategory in topmenu</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="parenCategoryName" type="string"/>
16+
<argument name="childCategoryName" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(parenCategoryName)}}" stepKey="waitForTopMenuLoaded"/>
20+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parenCategoryName)}}" stepKey="moveMouseToParentCategory"/>
21+
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(childCategoryName)}}" stepKey="seeSubcategoryInTree"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Page/AdminCategoryEditPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<section name="AdminCategoryModalSection"/>
2020
<section name="AdminCategoryMessagesSection"/>
2121
<section name="AdminCategoryContentSection"/>
22+
<section name="AdminCategoryScheduleDesignUpdateSection"/>
2223
</page>
2324
</pages>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="FieldError" type="text" selector=".admin__field-error[data-bind='attr: {for: {{field}}}, text: error']" parameterized="true"/>
2323
<element name="panelFieldControl" type="input" selector="//aside//div[@data-index=&quot;{{arg1}}&quot;]/descendant::*[@name=&quot;{{arg2}}&quot;]" parameterized="true"/>
2424
<element name="productsInCategory" type="input" selector="div[data-index='assign_products']" timeout="30"/>
25+
<element name="scheduleDesignUpdateTab" type="block" selector="div[data-index='schedule_design_update']" timeout="15"/>
2526
</section>
2627
</sections>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminCategoryScheduleDesignUpdateSection">
11+
<element name="sectionHeader" type="button" selector="div[data-index='schedule_design_update'] .fieldset-wrapper-title" timeout="30"/>
12+
<element name="sectionBody" type="text" selector="div[data-index='schedule_design_update'] .admin__fieldset-wrapper-content"/>
13+
</section>
14+
</sections>

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminProductCategoryIndexerInUpdateOnScheduleModeTest">
1212
<annotations>
13+
<features value="Catalog"/>
1314
<stories value="Product Categories Indexer"/>
1415
<title value="Product Categories Indexer in Update on Schedule mode"/>
1516
<description value="The test verifies that in Update on Schedule mode if displaying of category products on Storefront changes due to product properties change,
1617
the changes are NOT applied immediately, but applied only after cron runs (twice)."/>
17-
<severity value="BLOCKER"/>
18-
<testCaseId value="MC-11146"/>
18+
<severity value="CRITICAL"/>
19+
<testCaseId value="MC-26119"/>
1920
<group value="catalog"/>
2021
<group value="indexer"/>
21-
<skip>
22-
<issueId value="MC-20392"/>
23-
</skip>
2422
</annotations>
2523
<before>
2624
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>

app/code/Magento/Catalog/Test/Unit/Model/Plugin/ProductRepository/TransactionWrapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function setUp(): void
6262
$this->closureMock = function () use ($productMock) {
6363
return $productMock;
6464
};
65-
$this->rollbackClosureMock = function () use ($productMock) {
65+
$this->rollbackClosureMock = function () {
6666
throw new \Exception(self::ERROR_MSG);
6767
};
6868

app/code/Magento/CatalogCustomerGraphQl/Model/Resolver/TierPrices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function resolve(
8787
$this->tiers->addProductFilter($productId);
8888

8989
return $this->valueFactory->create(
90-
function () use ($productId, $context) {
90+
function () use ($productId) {
9191
$tierPrices = $this->tiers->getProductTierPrices($productId);
9292

9393
return $tierPrices ?? [];

app/code/Magento/CatalogSearch/Model/Advanced.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ protected function getPreparedSearchCriteria($attribute, $value)
359359
if (is_array($value)) {
360360
if (isset($value['from']) && isset($value['to'])) {
361361
if (!empty($value['from']) || !empty($value['to'])) {
362+
$from = '';
363+
$to = '';
362364
if (isset($value['currency'])) {
363365
/** @var $currencyModel Currency */
364366
$currencyModel = $this->_currencyFactory->create()->load($value['currency']);

app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/>
2525
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/>
2626
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/>
27-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
27+
<waitForPageLoad stepKey="waitForLoadingMask"/>
2828
<click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
29-
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
29+
<waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
30+
<waitForPageLoad stepKey="waitForShippingLoadingMask"/>
3031
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
31-
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
32+
<waitForElementVisible selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
3233
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
3334
</actionGroup>
3435
</actionGroups>

app/code/Magento/Customer/Controller/Adminhtml/Index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,8 @@ protected function prepareDefaultCustomerTitle(\Magento\Backend\Model\View\Resul
289289
protected function _addSessionErrorMessages($messages)
290290
{
291291
$messages = (array)$messages;
292-
$session = $this->_getSession();
293292

294-
$callback = function ($error) use ($session) {
293+
$callback = function ($error) {
295294
if (!$error instanceof Error) {
296295
$error = new Error($error);
297296
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontCustomerHasNoOtherAddressesActionGroup">
11+
<annotations>
12+
<description>Verifies customer has no additional address in address book</description>
13+
</annotations>
14+
<amOnPage url="{{StorefrontCustomerAddressesPage.url}}" stepKey="goToAddressPage"/>
15+
<waitForText userInput="You have no other address entries in your address book." selector=".block-addresses-list" stepKey="assertOtherAddresses"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/BillingTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
1313
use Magento\Framework\DataObject;
1414
use PHPUnit\Framework\TestCase;
15-
use Psr\Log\LoggerInterface;
1615

1716
class BillingTest extends TestCase
1817
{
@@ -23,10 +22,7 @@ class BillingTest extends TestCase
2322

2423
protected function setUp(): void
2524
{
26-
$logger = $this->getMockBuilder(LoggerInterface::class)
27-
->getMock();
28-
/** @var LoggerInterface $logger */
29-
$this->testable = new Billing($logger);
25+
$this->testable = new Billing();
3026
}
3127

3228
public function testBeforeSave()

app/code/Magento/Customer/Test/Unit/Model/Customer/Attribute/Backend/ShippingTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
1313
use Magento\Framework\DataObject;
1414
use PHPUnit\Framework\TestCase;
15-
use Psr\Log\LoggerInterface;
1615

1716
class ShippingTest extends TestCase
1817
{
@@ -23,10 +22,7 @@ class ShippingTest extends TestCase
2322

2423
protected function setUp(): void
2524
{
26-
$logger = $this->getMockBuilder(LoggerInterface::class)
27-
->getMock();
28-
/** @var LoggerInterface $logger */
29-
$this->testable = new Shipping($logger);
25+
$this->testable = new Shipping();
3026
}
3127

3228
public function testBeforeSave()

app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected function setUp(): void
6262
$this->closureMock = function () use ($customerMock) {
6363
return $customerMock;
6464
};
65-
$this->rollbackClosureMock = function () use ($customerMock) {
65+
$this->rollbackClosureMock = function () {
6666
throw new \Exception(self::ERROR_MSG);
6767
};
6868

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,9 @@ public function initFromOrder(\Magento\Sales\Model\Order $order)
550550

551551
$quote = $this->getQuote();
552552
if (!$quote->isVirtual() && $this->getShippingAddress()->getSameAsBilling()) {
553+
$quote->getBillingAddress()->setCustomerAddressId(
554+
$quote->getShippingAddress()->getCustomerAddressId()
555+
);
553556
$this->setShippingAsBilling(1);
554557
}
555558

@@ -2120,6 +2123,9 @@ private function isAddressesAreEqual(Order $order)
21202123
$billingData['address_type'],
21212124
$billingData['entity_id']
21222125
);
2126+
if (isset($shippingData['customer_address_id']) && !isset($billingData['customer_address_id'])) {
2127+
unset($shippingData['customer_address_id']);
2128+
}
21232129

21242130
return $shippingData == $billingData;
21252131
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminStartReorderFromOrderPageActionGroup">
11+
<annotations>
12+
<description>Reorder existing order. Requires admin order page to be opened.</description>
13+
</annotations>
14+
15+
<click selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="clickReorder"/>
16+
<waitForPageLoad stepKey="waitPageLoad"/>
17+
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/>
18+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeCreateNewOrderPageTitle"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminReorderAddressNotSavedInAddressBookTest">
11+
<annotations>
12+
<features value="Sales"/>
13+
<stories value="Reorder"/>
14+
<title value="Same shipping address is not repeating multiple times in storefront checkout when Reordered"/>
15+
<description value="Same shipping address is not repeating multiple times in storefront checkout when Reordered"/>
16+
<testCaseId value="MC-38412"/>
17+
<useCaseId value="MC-38113"/>
18+
<severity value="MAJOR"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiCategory" stepKey="category"/>
23+
<createData entity="ApiSimpleProduct" stepKey="product">
24+
<requiredEntity createDataKey="category"/>
25+
</createData>
26+
<createData entity="Simple_Customer_Without_Address" stepKey="customer"/>
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
28+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
29+
<argument name="Customer" value="$customer$"/>
30+
</actionGroup>
31+
</before>
32+
<after>
33+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
34+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
35+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
36+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
37+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
38+
</after>
39+
40+
<!-- Create order for registered customer -->
41+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToOrder">
42+
<argument name="product" value="$product$"/>
43+
</actionGroup>
44+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="openCheckoutPage"/>
45+
<actionGroup ref="LoggedInUserCheckoutFillingShippingSectionActionGroup" stepKey="fillAddressForm"/>
46+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/>
47+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
48+
49+
<!-- Reorder created order -->
50+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById">
51+
<argument name="orderId" value="{$grabOrderNumber}"/>
52+
</actionGroup>
53+
<actionGroup ref="AdminStartReorderFromOrderPageActionGroup" stepKey="startReorder"/>
54+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
55+
56+
<!-- Assert no additional addresses saved -->
57+
<actionGroup ref="AssertStorefrontCustomerHasNoOtherAddressesActionGroup" stepKey="assertAddresses"/>
58+
</test>
59+
</tests>

app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ endif; ?>
114114
type="checkbox"
115115
id="<?= $block->escapeHtmlAttr($block->getForm()->getHtmlIdPrefix()) ?>save_in_address_book"
116116
value="1"
117-
<?php if (!$block->getDontSaveInAddressBook()): ?> checked="checked"<?php endif; ?>
117+
<?php if (!$block->getDontSaveInAddressBook() && !$block->getAddressId()): ?>
118+
checked="checked"
119+
<?php endif; ?>
118120
class="admin__control-checkbox"/>
119121
<label for="<?= $block->escapeHtmlAttr($block->getForm()->getHtmlIdPrefix()) ?>save_in_address_book"
120122
class="admin__field-label"><?= $block->escapeHtml(__('Save in address book')) ?></label>

app/code/Magento/SendFriend/Model/ResourceModel/SendFriend.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
namespace Magento\SendFriend\Model\ResourceModel;
77

88
/**
9-
* SendFriend Log Resource Model
10-
*
11-
* @author Magento Core Team <[email protected]>
12-
*
139
* @api
1410
* @since 100.0.2
1511
*/
@@ -32,6 +28,7 @@ protected function _construct()
3228
* @param int $ip
3329
* @param int $startTime
3430
* @param int $websiteId
31+
*
3532
* @return int
3633
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3734
*/
@@ -46,7 +43,7 @@ public function getSendCount($object, $ip, $startTime, $websiteId = null)
4643
AND time>=:time
4744
AND website_id=:website_id'
4845
);
49-
$bind = ['ip' => ip2long($ip), 'time' => $startTime, 'website_id' => (int)$websiteId];
46+
$bind = ['ip' => $ip, 'time' => $startTime, 'website_id' => (int)$websiteId];
5047

5148
$row = $connection->fetchRow($select, $bind);
5249
return $row['count'];
@@ -58,21 +55,24 @@ public function getSendCount($object, $ip, $startTime, $websiteId = null)
5855
* @param int $ip
5956
* @param int $startTime
6057
* @param int $websiteId
58+
*
6159
* @return $this
6260
*/
6361
public function addSendItem($ip, $startTime, $websiteId)
6462
{
6563
$this->getConnection()->insert(
6664
$this->getMainTable(),
67-
['ip' => ip2long($ip), 'time' => $startTime, 'website_id' => $websiteId]
65+
['ip' => $ip, 'time' => $startTime, 'website_id' => $websiteId]
6866
);
67+
6968
return $this;
7069
}
7170

7271
/**
7372
* Delete Old logs
7473
*
7574
* @param int $time
75+
*
7676
* @return $this
7777
*/
7878
public function deleteLogsBefore($time)

0 commit comments

Comments
 (0)