Skip to content

Commit b941603

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #31022: ISSUE-30265 - Fix product add / remove in Safari when creating an order in admin (by @zaximus84) - #30868: Fixed "Email Copy of Invoice", "Email Copy of Shipment" and "Email Copy of Creditmemo" Issues (by @gwharton) - #30822: Fix iterate on null (by @thomas-kl1) - #30910: Ensure that url suffix resolvers return strings to match function declaration (by @aligent-lturner) - #28926: Fix for communication.xml Handlers merging processs (by @matiashidalgo) - #31013: [MFTF] Adding AdminSetStockStatusActionGroup (by @AnnaAPak) - #31079: [MFTF] Refactoring of AdminMassUpdateProductAttributesMissingRequiredFieldTest (by @AnnaAPak) - #31151: Use magento coding standard 6 (by @ihor-sviziev) - #30477: Fix issue #30270 Product Reviews can not be sorted by Admin on the Product edit page (by @Chandresh22) - #30953: set correct remaining available discount amount when applying fixed p… (by @sky-hub) - #27845: Allow customer to specify associated product qtys when adding grouped product to cart via RESTful API (by @shawnabramson) - #30626: Handle exceptions thrown in child processes forked by ProcessManager (by @pawel-siejba) Fixed GitHub Issues: - #30265: SAFARI: endless deploy when admin try to add product in order (reported by @magento-engcom-team) has been fixed in #31022 by @zaximus84 in 2.4-develop branch Related commits: 1. d018988 - #28511: New Invoice: Checkbox "Email Copy of Invoice" is useless (reported by @TerrapinSoftware) has been fixed in #30868 by @gwharton in 2.4-develop branch Related commits: 1. e0d8149 - #30830: [Issue] Fix iterate on null (reported by @m2-assistant[bot]) has been fixed in #30822 by @thomas-kl1 in 2.4-develop branch Related commits: 1. f5d692f 2. 73edcb1 3. 8fcac9d 4. 5029cb0 5. e8294f8 - #30909: ProductUrlSuffix and CategoryUrlSuffix GraphQL resolvers fail with null values (reported by @aligent-lturner) has been fixed in #30910 by @aligent-lturner in 2.4-develop branch Related commits: 1. 5512626 2. ffcc523 3. 673edbe 4. 53ed515 - #29528: [Issue] Fix for communication.xml Handlers merging processs (reported by @m2-assistant[bot]) has been fixed in #28926 by @matiashidalgo in 2.4-develop branch Related commits: 1. fb9f52d 2. 2cbb726 3. 11ccb29 4. 623e87f 5. d5680d2 6. cf9de17 7. 8e054c7 8. e7cde72 9. 90e457d 10. 1bf790a 11. c373f3e 12. 0cfb88a 13. be308fa - #31034: [Issue] [MFTF] Adding AdminSetStockStatusActionGroup (reported by @m2-assistant[bot]) has been fixed in #31013 by @AnnaAPak in 2.4-develop branch Related commits: 1. 3adff7a 2. fe4a58f 3. b542bd8 4. 0b882f3 5. 8626a36 6. f95ed51 - #31160: [Issue] [MFTF] Refactoring of AdminMassUpdateProductAttributesMissingRequiredFieldTest (reported by @m2-assistant[bot]) has been fixed in #31079 by @AnnaAPak in 2.4-develop branch Related commits: 1. a3aa42c 2. 42a2d1f - #31152: Update Magento Coding Standard to version 6 (reported by @sivaschenko) has been fixed in #31151 by @ihor-sviziev in 2.4-develop branch Related commits: 1. 55926f8 - #30270: �Product Reviews� can not be sorted by Admin on the Product page (reported by @magento-engcom-team) has been fixed in #30477 by @Chandresh22 in 2.4-develop branch Related commits: 1. 4c5a130 2. 4e80ef9 3. c1eb748 4. 1c6672e 5. 9bd848a 6. f18ab23 7. da7bb72 8. 379027f 9. be1d79a 10. 3eb3553 11. 9985552 - #30952: [Cart Rule] Incorrect discount amount applied for bundle products containing more than one option (reported by @sky-hub) has been fixed in #30953 by @sky-hub in 2.4-develop branch Related commits: 1. d56db5b 2. 4d1e4ea 3. 12806e0 4. b4275c9 5. aa7e7cd 6. a24dc14 7. 963b28f 8. cfb8f02 9. 6015ada 10. eeda660 11. 47149bf 12. 15bc12c - #26909: Add grouped product with individual quantity to cart using rest api (reported by @manish-sirvi) has been fixed in #27845 by @shawnabramson in 2.4-develop branch Related commits: 1. dcc6381 2. de1f626 3. 8d2c280 4. e9fa0a8 5. d5160db 6. 8b141e1 7. bb9c1e2 8. 3bcdd48 9. 7f49335 10. 3626d9c 11. cc0c942 12. 74709d2 13. fa4c7b8 14. 24c27a4 15. be84eb1 16. c936161 17. 7af13d7 18. 4240a6b 19. 768b305 20. 4aa5527 21. 0ace0c3 22. bdfe7ec 23. 769653a - #30622: Process Manager doesn't handle exceptions properly in forked processes (reported by @pawel-siejba) has been fixed in #30626 by @pawel-siejba in 2.4-develop branch Related commits: 1. 5a5b6f7
2 parents 5e225d6 + 784c3aa commit b941603

File tree

47 files changed

+1896
-210
lines changed

Some content is hidden

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

47 files changed

+1896
-210
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup">
12+
<annotations>
13+
<description>Click the "Change" checkbox for the "Name" field on the Products Masss Attributes Update page.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>
17+
18+
</actionGroup>
19+
</actionGroups>
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="AdminCheckProductOnProductGridActionGroup">
12+
<annotations>
13+
<description>Check the checkbox for the product on the Product Grid</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" type="entity"/>
17+
</arguments>
18+
19+
<checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku(product.sku)}}" stepKey="selectProduct"/>
20+
21+
</actionGroup>
22+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickSaveOnProductsMassAttributesUpdateActionGroup">
12+
<annotations>
13+
<description>Clicks on 'Save' button on products mass attributes update page.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
17+
<waitForPageLoad stepKey="waitForUpdateAttributesPage"/>
18+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Update Attributes" stepKey="seeUpdateAttributesTitle"/>
19+
</actionGroup>
20+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSetStockStatusActionGroup">
12+
<annotations>
13+
<description>Set Stock Status of product.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="stockStatus" type="string" defaultValue="In Stock"/>
18+
</arguments>
19+
20+
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{stockStatus}}" stepKey="setStockStatus"/>
21+
22+
</actionGroup>
23+
</actionGroups>

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
<scrollTo selector="{{AdminProductFormSection.productQuantity}}" stepKey="scrollToProductQuantity" after="waitForProductPageToLoad"/>
2222
<remove keyForRemoval="disableProduct"/>
23-
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="selectOutOfStock" after="scrollToProductQuantity"/>
23+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectOutOfStock" after="scrollToProductQuantity">
24+
<argument name="stockStatus" value="Out of Stock"/>
25+
</actionGroup>
26+
2427
</test>
2528
</tests>

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
<waitForPageLoad stepKey="waitForProductToLoad"/>
5454

5555
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/>
56-
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/>
56+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus">
57+
<argument name="stockStatus" value="In Stock"/>
58+
</actionGroup>
5759

5860
<!-- Create New Product Attribute -->
5961
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/>

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
<waitForPageLoad stepKey="waitForProductToLoad"/>
5151

5252
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="100" stepKey="fillProductQty"/>
53-
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="selectStockStatus"/>
53+
<actionGroup ref="AdminSetStockStatusActionGroup" stepKey="selectStockStatus">
54+
<argument name="stockStatus" value="In Stock"/>
55+
</actionGroup>
5456

5557
<!-- Create Product Attribute -->
5658
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickOnAddAttribute"/>

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

+17-10
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,27 @@
3636
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3737
</after>
3838

39-
<!-- Search and select products -->
4039
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
4140
<actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword">
4241
<argument name="keyword" value="api-simple-product"/>
4342
</actionGroup>
44-
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/>
45-
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/>
46-
<!-- Mass update attributes -->
47-
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
48-
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
49-
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
50-
<seeInCurrentUrl stepKey="seeInUrl" url="catalog/product_action_attribute/edit/"/>
51-
<click selector="{{AdminEditProductAttributesSection.ChangeAttributeNameToggle}}" stepKey="toggleToChangeName"/>
52-
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
43+
44+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox1">
45+
<argument name="product" value="$$createProductOne$$"/>
46+
</actionGroup>
47+
48+
<actionGroup ref="AdminCheckProductOnProductGridActionGroup" stepKey="clickCheckbox2">
49+
<argument name="product" value="$$createProductTwo$$"/>
50+
</actionGroup>
51+
52+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="clickDropdown"/>
53+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOption"/>
54+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBulkUpdatePage"/>
55+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeInUrl"/>
56+
57+
<actionGroup ref="AdminCheckNameToggleOnProductsMassAttributesUpdateActionGroup" stepKey="toggleToChangeName"/>
58+
59+
<actionGroup ref="AdminClickSaveOnProductsMassAttributesUpdateActionGroup" stepKey="save"/>
5360
<see stepKey="seeError" selector="{{AdminEditProductAttributesSection.NameError}}" userInput="This is a required field"/>
5461
</test>
5562
</tests>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/configure.phtml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ $blockId = $block->getId();
1010
<div id="product_composite_configure"
1111
class="product-configure-popup product-configure-popup-<?= $block->escapeHtmlAttr($blockId) ?>">
1212
<iframe name="product_composite_configure_iframe" id="product_composite_configure_iframe"></iframe>
13-
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
14-
'onload',
15-
"window.productConfigure && productConfigure.onLoadIFrame()",
16-
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
17-
) ?>
1813

1914
<form action="" method="post" id="product_composite_configure_form" enctype="multipart/form-data"
2015
target="product_composite_configure_iframe" class="product_composite_configure_form">
@@ -85,3 +80,8 @@ script;
8580
?>
8681
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
8782
</div>
83+
<?= /* @noEscape */ $secureRenderer->renderEventListenerAsTag(
84+
'onload',
85+
"window.productConfigure && productConfigure.onLoadIFrame()",
86+
'iframe[name=\'product_composite_configure_iframe\']:last-of-type'
87+
) ?>

app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/CategoryUrlSuffix.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function getCategoryUrlSuffix(int $storeId): ?string
7575
self::$xml_path_category_url_suffix,
7676
ScopeInterface::SCOPE_STORE,
7777
$storeId
78-
);
78+
) ?? '';
7979
}
8080
return $this->categoryUrlSuffix[$storeId];
8181
}

app/code/Magento/CatalogUrlRewriteGraphQl/Model/Resolver/ProductUrlSuffix.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function getProductUrlSuffix(int $storeId): ?string
7575
self::$xml_path_product_url_suffix,
7676
ScopeInterface::SCOPE_STORE,
7777
$storeId
78-
);
78+
) ?? '';
7979
}
8080
return $this->productUrlSuffix[$storeId];
8181
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CatalogUrlRewriteGraphQl\Test\Unit\Model\Resolver;
8+
9+
use Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix;
10+
use Magento\Framework\GraphQl\Config\Element\Field;
11+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
12+
use Magento\GraphQl\Model\Query\ContextExtensionInterface;
13+
use Magento\GraphQl\Model\Query\ContextInterface;
14+
use Magento\Store\Api\Data\StoreInterface;
15+
use PHPUnit\Framework\MockObject\MockObject;
16+
use PHPUnit\Framework\TestCase;
17+
use Magento\Framework\App\Config\ScopeConfigInterface;
18+
19+
/**
20+
* Test for \Magento\CatalogUrlRewriteGraphQl\Model\Resolver\CategoryUrlSuffix.
21+
*/
22+
class CategoryUrlSuffixTest extends TestCase
23+
{
24+
/**
25+
* @var ScopeConfigInterface|MockObject
26+
*/
27+
private $scopeConfigMock;
28+
29+
/**
30+
* @var ContextInterface|MockObject
31+
*/
32+
private $contextMock;
33+
34+
/**
35+
* @var ContextExtensionInterface|MockObject
36+
*/
37+
private $contextExtensionMock;
38+
39+
/**
40+
* @var StoreInterface|MockObject
41+
*/
42+
private $storeMock;
43+
44+
/**
45+
* @var Field|MockObject
46+
*/
47+
private $fieldMock;
48+
49+
/**
50+
* @var ResolveInfo|MockObject
51+
*/
52+
private $resolveInfoMock;
53+
54+
/**
55+
* @var CategoryUrlSuffix
56+
*/
57+
private $resolver;
58+
59+
/**
60+
* @inheritDoc
61+
*/
62+
protected function setUp(): void
63+
{
64+
$this->contextMock = $this->getMockBuilder(ContextInterface::class)
65+
->disableOriginalConstructor()
66+
->setMethods(
67+
[
68+
'getExtensionAttributes'
69+
]
70+
)
71+
->getMockForAbstractClass();
72+
73+
$this->contextExtensionMock = $this->getMockBuilder(ContextExtensionInterface::class)
74+
->setMethods(
75+
[
76+
'getStore'
77+
]
78+
)
79+
->getMockForAbstractClass();
80+
81+
$this->storeMock = $this->getMockBuilder(StoreInterface::class)
82+
->setMethods(
83+
[
84+
'getId'
85+
]
86+
)
87+
->getMockForAbstractClass();
88+
89+
$this->fieldMock = $this->getMockBuilder(Field::class)
90+
->disableOriginalConstructor()
91+
->getMock();
92+
93+
$this->resolveInfoMock = $this->getMockBuilder(ResolveInfo::class)
94+
->disableOriginalConstructor()
95+
->getMock();
96+
97+
$this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)
98+
->getMockForAbstractClass();
99+
100+
$this->resolver = new CategoryUrlSuffix(
101+
$this->scopeConfigMock
102+
);
103+
}
104+
105+
/**
106+
* Verify that empty string is returned when config value is null
107+
*/
108+
public function testNullValue()
109+
{
110+
$this->scopeConfigMock->expects($this->once())
111+
->method('getValue')
112+
->willReturn(null);
113+
114+
$this->contextMock
115+
->expects($this->once())
116+
->method('getExtensionAttributes')
117+
->willReturn($this->contextExtensionMock);
118+
119+
$this->contextExtensionMock
120+
->expects($this->once())
121+
->method('getStore')
122+
->willReturn($this->storeMock);
123+
124+
$this->storeMock
125+
->expects($this->once())
126+
->method('getId')
127+
->willReturn(1);
128+
129+
$this->assertEquals(
130+
'',
131+
$this->resolver->resolve(
132+
$this->fieldMock,
133+
$this->contextMock,
134+
$this->resolveInfoMock
135+
)
136+
);
137+
}
138+
139+
/**
140+
* Verify that the configured value is returned
141+
*/
142+
public function testNonNullValue()
143+
{
144+
$value = 'html';
145+
$this->scopeConfigMock->expects($this->once())
146+
->method('getValue')
147+
->willReturn($value);
148+
149+
$this->contextMock
150+
->expects($this->once())
151+
->method('getExtensionAttributes')
152+
->willReturn($this->contextExtensionMock);
153+
154+
$this->contextExtensionMock
155+
->expects($this->once())
156+
->method('getStore')
157+
->willReturn($this->storeMock);
158+
159+
$this->storeMock
160+
->expects($this->once())
161+
->method('getId')
162+
->willReturn(1);
163+
164+
$this->assertEquals(
165+
$value,
166+
$this->resolver->resolve(
167+
$this->fieldMock,
168+
$this->contextMock,
169+
$this->resolveInfoMock
170+
)
171+
);
172+
}
173+
}

0 commit comments

Comments
 (0)