Skip to content

Commit be9b1fe

Browse files
authored
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #34128: [MTTF] Excessive order grid filtering actions removing (by @AnnaAPak) - #33149: MFTF: Admin Create Attribute Rating Test (by @DmitryTsymbal) - #33886: Replaced PHP8-only str_contains method. (by @reense) - #33683: [MFTF] Refactoring StorefrontOrderPagerIsAbsentTest (by @AnnaAPak) - #33726: Fix "area code is not set" in all commands that depend on Payment/Helper/Data (by @marvinhinz) - #33095: Static CMS image urls when using a different (sub)domain for custom admin url (by @engcom-Kilo) - #32808: Do not trigger url rewrites re-generation for all store views (by @ihor-sviziev) Fixed GitHub Issues: - #33680: Unsupported PHP 8 command in Magento (reported by @michalrostek) has been fixed in #33886 by @reense in 2.4-develop branch Related commits: 1. 055d9fc 2. 5888eea 3. cda98b5 4. b72097d - #33755: Magento 2.4.2 to 2.4.3 Upgrade Issue use php 8 function (reported by @magedevel) has been fixed in #33886 by @reense in 2.4-develop branch Related commits: 1. 055d9fc 2. 5888eea 3. cda98b5 4. b72097d - #33945: Error with PHP 8 str_contains function when upgrade to 2.4.3 (reported by @manhtranisobar) has been fixed in #33886 by @reense in 2.4-develop branch Related commits: 1. 055d9fc 2. 5888eea 3. cda98b5 4. b72097d - #33760: Magento 2.4.2 composer upgrade broke after 2.4.3 released (reported by @EliminatorRC-Christian) has been fixed in #33726 by @marvinhinz in 2.4-develop branch Related commits: 1. d0f2201 2. b4a7f92 3. ee828bc 4. 1a3a59f 5. 63e87da 6. e264762 7. 2c2454a 8. 19178be 9. c8777f0 10. aaf035d - #33908: [Issue] Fix "area code is not set" in all commands that depend on Payment/Helper/Data (reported by @m2-assistant[bot]) has been fixed in #33726 by @marvinhinz in 2.4-develop branch Related commits: 1. d0f2201 2. b4a7f92 3. ee828bc 4. 1a3a59f 5. 63e87da 6. e264762 7. 2c2454a 8. 19178be 9. c8777f0 10. aaf035d - #32930: Static CMS image urls when using a different (sub)domain for custom admin url (reported by @elouwerse) has been fixed in #33095 by @engcom-Kilo in 2.4-develop branch Related commits: 1. a61277c - #32954: [Issue] Do not trigger url rewrites re-generation for all store views (reported by @m2-assistant[bot]) has been fixed in #32808 by @ihor-sviziev in 2.4-develop branch Related commits: 1. 181507c 2. 43d6603
2 parents 34c04f6 + a7322cb commit be9b1fe

File tree

29 files changed

+576
-242
lines changed

29 files changed

+576
-242
lines changed

app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/Group.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function afterSave(
9292
AbstractModel $group
9393
) {
9494
if (!$group->isObjectNew()
95+
&& $group->getStoreIds()
9596
&& ($group->dataHasChangedFor('website_id')
9697
|| $group->dataHasChangedFor('root_category_id'))
9798
) {

app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/Store/GroupTest.php

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ protected function setUp(): void
8888
->disableOriginalConstructor()
8989
->setMethods(['isObjectNew', 'dataHasChangedFor', 'getStoreIds'])
9090
->getMockForAbstractClass();
91-
$this->abstractModelMock->expects($this->any())
92-
->method('getStoreIds')
93-
->willReturn([]);
9491
$this->subjectMock = $this->getMockBuilder(Group::class)
9592
->disableOriginalConstructor()
9693
->getMock();
@@ -138,6 +135,9 @@ public function testAfterSave()
138135
$this->abstractModelMock->expects($this->once())
139136
->method('isObjectNew')
140137
->willReturn(false);
138+
$this->abstractModelMock->expects($this->any())
139+
->method('getStoreIds')
140+
->willReturn(['1']);
141141
$this->abstractModelMock->expects($this->once())
142142
->method('dataHasChangedFor')
143143
->with('website_id')
@@ -165,10 +165,10 @@ public function testAfterSave()
165165
$this->productCollectionMock->expects($this->once())
166166
->method('addWebsiteFilter')
167167
->willReturn($this->productCollectionMock);
168-
$iterator = new \ArrayIterator([$this->productMock]);
168+
$arrayIteratorMock = new \ArrayIterator([$this->productMock]);
169169
$this->productCollectionMock->expects($this->once())
170170
->method('getIterator')
171-
->willReturn($iterator);
171+
->willReturn($arrayIteratorMock);
172172
$this->productUrlRewriteGeneratorMock->expects($this->once())
173173
->method('generate')
174174
->with($this->productMock)
@@ -179,4 +179,33 @@ public function testAfterSave()
179179
$this->plugin->afterSave($this->subjectMock, $this->subjectMock, $this->abstractModelMock)
180180
);
181181
}
182+
183+
public function testAfterSaveWithNoStoresAssigned()
184+
{
185+
$this->abstractModelMock->expects($this->once())
186+
->method('isObjectNew')
187+
->willReturn(false);
188+
$this->abstractModelMock->expects($this->any())
189+
->method('getStoreIds')
190+
->willReturn([]);
191+
$this->abstractModelMock->expects($this->any())
192+
->method('dataHasChangedFor')
193+
->with('website_id')
194+
->willReturn(true);
195+
$this->storeManagerMock->expects($this->never())->method('reinitStores');
196+
$this->categoryMock->expects($this->never())->method('getCategories');
197+
$this->categoryFactoryMock->expects($this->never())->method('create');
198+
$this->productFactoryMock->expects($this->never())->method('create');
199+
$this->productMock->expects($this->never())->method('getCollection');
200+
$this->productCollectionMock->expects($this->never())->method('addCategoryIds');
201+
$this->productCollectionMock->expects($this->never()) ->method('addAttributeToSelect');
202+
$this->productCollectionMock->expects($this->never())->method('addWebsiteFilter');
203+
$this->productCollectionMock->expects($this->never())->method('getIterator');
204+
$this->productUrlRewriteGeneratorMock->expects($this->never())->method('generate');
205+
206+
$this->assertSame(
207+
$this->subjectMock,
208+
$this->plugin->afterSave($this->subjectMock, $this->subjectMock, $this->abstractModelMock)
209+
);
210+
}
182211
}

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,18 @@
8181
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/>
8282
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/>
8383
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
84+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
85+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
8486

8587
<!-- Login as admin -->
8688
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
8789

88-
<!-- Open created order in backend -->
89-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
90-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
91-
<argument name="orderId" value="$grabOrderNumber"/>
90+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
91+
<argument name="entityId" value="$grabOrderId"/>
9292
</actionGroup>
93-
93+
<comment userInput="Comment is added to preserve Backward Compatibility" stepKey="goToOrders"/>
94+
<comment userInput="Comment is added to preserve Backward Compatibility" stepKey="filterOrderGridById"/>
95+
9496
<!-- Assert order total -->
9597
<scrollTo selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="scrollToOrderTotalSection"/>
9698
<see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$565.00" stepKey="checkOrderTotalInBackend"/>

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,20 @@
9090
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/>
9191
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/>
9292
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
93+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
94+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
9395

9496
<!-- Login as admin -->
9597
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
98+
99+
<!--Step11. Go to admin Order page for newly created order-->
100+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openAdminOrderViewPage">
101+
<argument name="entityId" value="$grabOrderId"/>
102+
</actionGroup>
96103

97104
<!-- Open created order in backend -->
98-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
99-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
100-
<argument name="orderId" value="$grabOrderNumber"/>
101-
</actionGroup>
105+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToOrders"/>
106+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterOrderGridById"/>
102107

103108
<!-- Assert order total -->
104109
<scrollTo selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="scrollToOrderTotalSection"/>

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@
8383
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCheckoutPaymentSectionPageLoad"/>
8484
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderIsSuccessfullyPlaced"/>
8585
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
86+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
87+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
8688

8789
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
8890

89-
<!-- Open created order in backend -->
90-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
91-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
92-
<argument name="orderId" value="$grabOrderNumber"/>
91+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
92+
<argument name="entityId" value="$grabOrderId"/>
9393
</actionGroup>
94+
<comment userInput="Comment is added to preserve Backward Compatibility" stepKey="goToOrders"/>
95+
<comment userInput="Comment is added to preserve Backward Compatibility" stepKey="filterOrderGridById"/>
9496

9597
<!-- Assert order total -->
9698
<scrollTo selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="scrollToOrderTotalSection"/>

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,19 @@
7575
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/>
7676
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/>
7777
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
78+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
79+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
7880

7981
<!-- Login as admin -->
8082
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
8183

8284
<!-- Open created order in backend -->
83-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
84-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
85-
<argument name="orderId" value="$grabOrderNumber"/>
85+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openAdminOrderViewPage">
86+
<argument name="entityId" value="$grabOrderId"/>
8687
</actionGroup>
8788

89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToOrders"/>
90+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterOrderGridById"/>
8891
<!-- Assert that shipping and billing address are the same -->
8992
<grabTextFrom selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" stepKey="shippingAddress"/>
9093
<grabTextFrom selector="{{AdminShipmentAddressInformationSection.billingAddress}}" stepKey="billingAddress"/>

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,19 @@
195195
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/>
196196
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced" />
197197
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
198+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
199+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
198200

199201
<!-- Login as admin -->
200202
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
201203

202204
<!-- Open created order -->
203-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
204-
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById">
205-
<argument name="orderId" value="$grabOrderNumber"/>
205+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openAdminOrderViewPage">
206+
<argument name="entityId" value="$grabOrderId"/>
206207
</actionGroup>
207208

209+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToOrders"/>
210+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterOrderGridById"/>
208211
<!-- Assert that addresses on order page the same -->
209212
<grabTextFrom selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" stepKey="shippingAddressOrderPage"/>
210213
<grabTextFrom selector="{{AdminShipmentAddressInformationSection.billingAddress}}" stepKey="billingAddressOrderPage"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,16 @@
7676
<!-- Place order and Assert success message -->
7777
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
7878
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/>
79+
<actionGroup ref="StorefrontClickOrderLinkFromCheckoutSuccessPageActionGroup" stepKey="openOrderViewPage"/>
80+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/>
7981

80-
<!-- Open Order Index Page -->
81-
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/>
82-
83-
<!-- Filter Order using orderId and assert order-->
84-
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById">
85-
<argument name="orderId" value="$orderId"/>
82+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openAdminOrderViewPage">
83+
<argument name="entityId" value="$grabOrderId"/>
8684
</actionGroup>
87-
88-
<click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/>
89-
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
85+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToOrders"/>
86+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterOrderGridById"/>
87+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnViewLink"/>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderPageToLoad"/>
9089

9190
<!-- Ship the order and assert the shipping status -->
9291
<actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/>

0 commit comments

Comments
 (0)