Skip to content

Commit 2a8a021

Browse files
authored
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop
Accepted Community Pull Requests: - #26628: Fixed #26513 (by @vikalps4) - #26614: #26612 Fix failure on Coupon Apply procedure when loading mask still visible (by @lbajsarowicz) - #26490: Fixed type issue. Create unit test for customer data model (by @AndreyChorniy) - #26558: [Csp] Covering the model classes by Unit Tests (by @eduard13) - #26435: #18012: added i18n wrapper to be used in underscore templates for translation (by @sergiy-v) - #26455: 25162 fixed wrong format link (by @Usik2203) - #26071: #26065 isSaleable cache and optimize result for configurable products (by @ilnytskyi) - #26540: Added action group for cms block duplication test (by @ajithkumar-maragathavel) - #26537: Covered admin cms block creatation with MFTF test (by @ajithkumar-maragathavel) - #26478: Unit Test for Magento\Fedex\Plugin\Block\DataProviders\Tracking\ChangeTitle (by @karyna-tsymbal-atwix) - #26509: Update PHP Docs (by @oroskodias) - #26511: Extend exception message (by @oroskodias) - #26512: Extend exception message (by @oroskodias) - #26480: Bugfix #26479 Exception when Autoloader was not registered properly (by @lbajsarowicz) - #26434: Fix typo in sitemap product collection docblock (by @Tjitse-E) - #26445: Fix #25761: Site map doesn't include home page (by @deepaksnair) - #26489: Checked if quote object contains id before looking for quote items (by @rav-redchamps) - #25994: Extend exception messages (by @oroskodias) - #26381: #25300 Mobile view issue on category page - Sort By label overlaps (by @akartavtsev) - #26285: Remove extraneous whitespace - #26275 (by @DanielRuf) - #26327: Fix the wrong behavior of validation scroll on the iPhone X (by @iGerchak) - #25385: Prevent page scroll jumping when product gallery loads (by @krzksz) - #25839: Fix gallery thumbs navigation scrolling (by @iGerchak) Fixed GitHub Issues: - #26612: MFTF: StorefrontApplyPromoCodeDuringCheckoutTest is failing in CI process (reported by @lbajsarowicz) has been fixed in #26614 by @lbajsarowicz in 2.4-develop branch Related commits: 1. c13b83f - #18012: Can not add string to underscore template using knockout (reported by @DanielRuf) has been fixed in #26435 by @sergiy-v in 2.4-develop branch Related commits: 1. 819c3f2 2. 064ee0e 3. 3a19f17 4. c32b643 5. e26bbc1 6. 69d07c1 7. 58adcc5 - #25162: Message at Frontend has No HTML format (reported by @edenduong) has been fixed in #26455 by @Usik2203 in 2.4-develop branch Related commits: 1. 690f791 2. 141ca96 3. f060ee7 4. 45cd0fa 5. 3e2ea3a 6. d6316cf 7. 1251f01 - #26065: Performance of isSalable method check on configurable product (reported by @ilnytskyi) has been fixed in #26071 by @ilnytskyi in 2.4-develop branch Related commits: 1. ad5c3e4 2. 87842d3 - #26479: Bug: AutoloaderRegistry::getAutoloader returns array (reported by @lbajsarowicz) has been fixed in #26480 by @lbajsarowicz in 2.4-develop branch Related commits: 1. ab1b1de 2. 61bc535 - #25761: Site map doesn't include home page (reported by @vseager) has been fixed in #26445 by @deepaksnair in 2.4-develop branch Related commits: 1. 3bffb4c 2. 57b8f53 3. f165a53 4. 8f5b2c7 5. d93fe31 6. dec8972 - #26437: Viewing customer shopping cart in admin shows all products in catalog when there is no active quote (reported by @mustdobetter) has been fixed in #26489 by @rav-redchamps in 2.4-develop branch Related commits: 1. 2312289 2. e9cb043 3. 8e2d9d4 4. 1dd3d90 5. 0173e34 6. a3dc450 7. 12b43c5 8. 58c4cc9 9. 907d0d6 - #25300: Mobile view issue on category page - Sort By label overlaps with Shop By button (reported by @rahulwebkul) has been fixed in #26381 by @akartavtsev in 2.4-develop branch Related commits: 1. bf580e4 2. 68ea88d 3. 8ebcc46 - #26275: Whitespace between label and required star on Checkout page (reported by @tejash-wagento) has been fixed in #26285 by @DanielRuf in 2.4-develop branch Related commits: 1. d9a4bca 2. 51f4964 3. 574f052 4. 0edeb06 5. fb208a8 6. c1c363f 7. 98e1159 8. 10cc12a 9. ff4ead5 10. 535b7c8 11. 4b86376 12. 3165046 13. 66a76f3 14. ca19b06 15. 60b7f1c 16. 1eed0f1 17. 5958409 18. 4b9b6fa - #10518: Mobile product page image jumps (reported by @bondimedical3) has been fixed in #25385 by @krzksz in 2.4-develop branch Related commits: 1. 0b278c8 2. d74f73c 3. 80b8514 4. c5991d3 5. acdc9b4 - #21717: Product view page scrolls up randomly on mobile device (reported by @xiaolinwuu) has been fixed in #25385 by @krzksz in 2.4-develop branch Related commits: 1. 0b278c8 2. d74f73c 3. 80b8514 4. c5991d3 5. acdc9b4 - #21014: Gallery Thumbnail (left/right) Scroll Performance Android Chrome Sluggish and Unresponsive (reported by @mplunkett5) has been fixed in #25839 by @iGerchak in 2.4-develop branch Related commits: 1. 3e57f87 2. 42a02d5
2 parents ba8fae3 + c41b7cb commit 2a8a021

File tree

57 files changed

+2126
-256
lines changed

Some content is hidden

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

57 files changed

+2126
-256
lines changed

app/code/Magento/Analytics/Model/Connector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
5353
public function execute($commandName)
5454
{
5555
if (!array_key_exists($commandName, $this->commands)) {
56-
throw new NotFoundException(__('Command was not found.'));
56+
throw new NotFoundException(__('Command "%1" was not found.', $commandName));
5757
}
5858

5959
/** @var \Magento\Analytics\Model\Connector\CommandInterface $command */

app/code/Magento/Analytics/Test/Unit/Model/ConnectorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ public function testExecute()
5757
}
5858

5959
/**
60+
* Executing non-existing command
61+
*
6062
* @expectedException \Magento\Framework\Exception\NotFoundException
63+
* @expectedExceptionMessage Command "register" was not found.
64+
* @return void
6165
*/
62-
public function testExecuteCommandNotFound()
66+
public function testExecuteCommandNotFound(): void
6367
{
6468
$commandName = 'register';
6569
$this->connector->execute($commandName);

app/code/Magento/Analytics/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"There was an error save new configuration value.","There was an error save new configuration value."
88
"Please select an industry.","Please select an industry."
99
"--Please Select--","--Please Select--"
10-
"Command was not found.","Command was not found."
10+
"Command "%1" was not found.","Command "%1" was not found."
1111
"Input data must be string or convertible into string.","Input data must be string or convertible into string."
1212
"Input data must be non-empty string.","Input data must be non-empty string."
1313
"Not valid cipher method.","Not valid cipher method."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<argument name="shippingMethod" value="Flat Rate"/>
5555
</actionGroup>
5656

57-
<!-- Click Apply Discount Code: section is expanded. Input promo code, apply and see success message -->
57+
<!-- Click Apply Discount Code: section is expanded. Input promo code, apply and see success message -->
5858
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCoupon">
5959
<argument name="discountCode" value="$$createCouponForCartPriceRule.code$$"/>
6060
</actionGroup>

app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
method="post">
1515
<fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading">
1616
<div class="field required">
17-
<label class="label" for="customer-email">
18-
<span data-bind="i18n: 'Email Address'"></span>
19-
</label>
17+
<label class="label" for="customer-email"><span data-bind="i18n: 'Email Address'"></span></label>
2018
<div class="control _with-tooltip">
2119
<input class="input-text"
2220
type="email"
@@ -35,9 +33,7 @@
3533
<!--Hidden fields -->
3634
<fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible">
3735
<div class="field">
38-
<label class="label" for="customer-password">
39-
<span data-bind="i18n: 'Password'"></span>
40-
</label>
36+
<label class="label" for="customer-password"><span data-bind="i18n: 'Password'"></span></label>
4137
<div class="control">
4238
<input class="input-text"
4339
data-bind="
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="SaveAndDuplicateCMSBlockWithSplitButtonActionGroup">
12+
<annotations>
13+
<description>Clicks on the Save and Duplicate button.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/>
17+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
18+
<click selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
19+
<waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/>
20+
<see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/>
21+
<see userInput="You duplicated the block." stepKey="seeDuplicatedBlockMsg"/>
22+
</actionGroup>
23+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="VerifyCmsBlockSaveSplitButtonActionGroup">
12+
<annotations>
13+
<description>verify Save and Close and Save and Duplicate button.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
<!--Verify Save&Duplicate button and Save&Close button-->
19+
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
20+
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
21+
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,18 @@
2828
</actionGroup>
2929
<actionGroup ref="logout" stepKey="logout"/>
3030
</after>
31-
<amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnBlocksCreationForm"/>
32-
<waitForPageLoad stepKey="waitForPageLoad1"/>
33-
<!--Verify Save&Duplicate button and Save&Close button-->
34-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn1" />
35-
<see selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" userInput="Save &amp; Duplicate" stepKey="seeSaveAndDuplicate"/>
36-
<see selector="{{BlockNewPagePageActionsSection.saveAndClose}}" userInput="Save &amp; Close" stepKey="seeSaveAndClose"/>
31+
<!-- Navigate to create cms block page and verify save split button -->
32+
<actionGroup ref="VerifyCmsBlockSaveSplitButtonActionGroup" stepKey="verifyCmsBlockSaveButton" />
3733
<!--Create new CMS Block page-->
3834
<actionGroup ref="FillOutBlockContent" stepKey="FillOutBlockContent"/>
39-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn2" />
40-
<click selector="{{BlockNewPagePageActionsSection.saveAndDuplicate}}" stepKey="clickSaveAndDuplicate" />
41-
<waitForPageLoad stepKey="waitForPageLoad3"/>
42-
<see userInput="You saved the block." stepKey="seeSavedBlockMsgOnForm"/>
43-
<see userInput="You duplicated the block." stepKey="seeDuplicatedBlockMsg"/>
35+
<!-- Click save and duplicate action -->
36+
<actionGroup ref="SaveAndDuplicateCMSBlockWithSplitButtonActionGroup" stepKey="clickSaveAndDuplicateButton" />
37+
4438
<!--Verify duplicated CMS Block Page-->
4539
<seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockNotEnable" />
4640
<actionGroup ref="AssertBlockContent" stepKey="assertContent"/>
47-
<click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn3" />
48-
<click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/>
49-
<see userInput="You saved the block." stepKey="seeSavedBlockMsgOnGrid"/>
41+
<!-- Click save and close button -->
42+
<actionGroup ref="SaveAndCloseCMSBlockWithSplitButtonActionGroup" stepKey="saveAndCloseAction" />
5043
<seeElement selector="div[data-role='grid-wrapper']" stepKey="seeGridPage" />
5144
</test>
52-
</tests>
45+
</tests>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminSaveAndCloseCmsBlockTest">
12+
<annotations>
13+
<features value="Cms"/>
14+
<stories value="CMS Block Creation and Reset Removal"/>
15+
<title value="Admin should be able to create a CMS block"/>
16+
<description value="Admin should be able to create a CMS block using save and close"/>
17+
<severity value="CRITICAL"/>
18+
<group value="Cms"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/>
22+
<actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/>
23+
</before>
24+
<after>
25+
<actionGroup ref="deleteBlock" stepKey="deleteCreatedBlock">
26+
<argument name="Block" value="_defaultBlock"/>
27+
</actionGroup>
28+
<actionGroup ref="logout" stepKey="logout"/>
29+
</after>
30+
<!-- Navigate to create cms block page and verify save split button -->
31+
<actionGroup ref="VerifyCmsBlockSaveSplitButtonActionGroup" stepKey="verifyCmsBlockSaveSplitButton" />
32+
<!--Create new CMS Block page-->
33+
<actionGroup ref="FillOutBlockContent" stepKey="FillOutBlockContent"/>
34+
<actionGroup ref="SaveAndCloseCMSBlockWithSplitButtonActionGroup" stepKey="saveCmsBlockContent" />
35+
</test>
36+
</tests>

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ class Configurable extends \Magento\Catalog\Model\Product\Type\AbstractType
102102
*/
103103
protected $_canConfigure = true;
104104

105+
/**
106+
* Local cache
107+
*
108+
* @var array
109+
*/
110+
protected $isSaleableBySku = [];
111+
105112
/**
106113
* @var \Magento\Framework\App\Config\ScopeConfigInterface
107114
*/
@@ -585,7 +592,7 @@ protected function getGalleryReadHandler()
585592
* @param \Magento\Catalog\Model\Product $product
586593
* @return \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection
587594
*/
588-
public function getUsedProductCollection($product)
595+
protected function getLinkedProductCollection($product)
589596
{
590597
$collection = $this->_productCollectionFactory->create()->setFlag(
591598
'product_children',
@@ -600,6 +607,17 @@ public function getUsedProductCollection($product)
600607
return $collection;
601608
}
602609

610+
/**
611+
* Retrieve related products collection. Extension point for listing
612+
*
613+
* @param \Magento\Catalog\Model\Product $product
614+
* @return \Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection
615+
*/
616+
public function getUsedProductCollection($product)
617+
{
618+
return $this->getLinkedProductCollection($product);
619+
}
620+
603621
/**
604622
* Before save process
605623
*
@@ -744,15 +762,27 @@ private function saveRelatedProducts(ProductInterface $product)
744762
*/
745763
public function isSalable($product)
746764
{
765+
$storeId = $this->getStoreFilter($product);
766+
if ($storeId instanceof \Magento\Store\Model\Store) {
767+
$storeId = $storeId->getId();
768+
}
769+
770+
$sku = $product->getSku();
771+
if (isset($this->isSaleableBySku[$storeId][$sku])) {
772+
return $this->isSaleableBySku[$storeId][$sku];
773+
}
774+
747775
$salable = parent::isSalable($product);
748776

749777
if ($salable !== false) {
750-
$collection = $this->getUsedProductCollection($product);
751-
$collection->addStoreFilter($this->getStoreFilter($product));
778+
$collection = $this->getLinkedProductCollection($product);
779+
$collection->addStoreFilter($storeId);
752780
$collection = $this->salableProcessor->process($collection);
753781
$salable = 0 !== $collection->getSize();
754782
}
755783

784+
$this->isSaleableBySku[$storeId][$sku] = $salable;
785+
756786
return $salable;
757787
}
758788

0 commit comments

Comments
 (0)