Skip to content

Commit c83ed2d

Browse files
merge magento/2.4-develop into magento-tsg/2.4-develop-pr6
2 parents 283d83f + 2a8a021 commit c83ed2d

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)