Skip to content

Commit d6d15d7

Browse files
Merge branch '2.4-develop' into 21237
2 parents 4afc05f + 8b38e63 commit d6d15d7

File tree

73 files changed

+2077
-355
lines changed

Some content is hidden

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

73 files changed

+2077
-355
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Fields marked with (*) are required. Please don't remove the template.
1111

1212
### Preconditions (*)
1313
<!---
14-
Provide the exact Magento version (example: 2.3.2) and any important information on the environment where bug is reproducible.
14+
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
1515
-->
1616
1.
1717
2.
@@ -32,3 +32,12 @@ Important: Provide a set of clear steps to reproduce this bug. We can not provid
3232
<!--- Tell us what happened instead. Include error messages and issues. -->
3333
1. [Screenshots, logs or description]
3434
2.
35+
36+
---
37+
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
38+
39+
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
40+
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
41+
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
42+
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
43+
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._

.github/ISSUE_TEMPLATE/developer-experience-issue.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@ Fields marked with (*) are required. Please don't remove the template.
1818

1919
### Proposed solution
2020
<!--- Suggest your potential solutions for this issue. -->
21+
22+
---
23+
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
24+
25+
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users with no workaround._
26+
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
27+
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
28+
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
29+
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
2424
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
2525
-->
26-
1. magento/magento2#<issue_number>: Issue title
26+
1. Fixes magento/magento2#<issue_number>
2727

2828
### Manual testing scenarios (*)
2929
<!---

app/code/Magento/Bundle/Model/ResourceModel/Option.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,29 +92,29 @@ protected function _afterSave(AbstractModel $object)
9292
{
9393
parent::_afterSave($object);
9494

95-
$condition = [
96-
'option_id = ?' => $object->getId(),
97-
'store_id = ? OR store_id = 0' => $object->getStoreId(),
98-
'parent_product_id = ?' => $object->getParentId()
99-
];
100-
10195
$connection = $this->getConnection();
102-
$connection->delete($this->getTable('catalog_product_bundle_option_value'), $condition);
103-
10496
$data = new DataObject();
10597
$data->setOptionId($object->getId())
10698
->setStoreId($object->getStoreId())
10799
->setParentProductId($object->getParentId())
108100
->setTitle($object->getTitle());
109101

110-
$connection->insert($this->getTable('catalog_product_bundle_option_value'), $data->getData());
102+
$connection->insertOnDuplicate(
103+
$this->getTable('catalog_product_bundle_option_value'),
104+
$data->getData(),
105+
['title']
106+
);
111107

112108
/**
113109
* also saving default fallback value
114110
*/
115111
if (0 !== (int)$object->getStoreId()) {
116112
$data->setStoreId(0)->setTitle($object->getDefaultTitle());
117-
$connection->insert($this->getTable('catalog_product_bundle_option_value'), $data->getData());
113+
$connection->insertOnDuplicate(
114+
$this->getTable('catalog_product_bundle_option_value'),
115+
$data->getData(),
116+
['title']
117+
);
118118
}
119119

120120
return $this;

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,6 @@ protected function _saveCategoryProducts($category)
469469

470470
if (!empty($insert) || !empty($delete)) {
471471
$productIds = array_unique(array_merge(array_keys($insert), array_keys($delete)));
472-
$this->_eventManager->dispatch(
473-
'catalog_category_change_products',
474-
['category' => $category, 'product_ids' => $productIds]
475-
);
476472

477473
$category->setChangedProductIds($productIds);
478474
}
@@ -484,6 +480,10 @@ protected function _saveCategoryProducts($category)
484480
* Setting affected products to category for third party engine index refresh
485481
*/
486482
$productIds = array_keys($insert + $delete + $update);
483+
$this->_eventManager->dispatch(
484+
'catalog_category_change_products',
485+
['category' => $category, 'product_ids' => $productIds]
486+
);
487487
$category->setAffectedProductIds($productIds);
488488
}
489489
return $this;
@@ -1078,7 +1078,6 @@ public function countVisible()
10781078
*/
10791079
public function load($object, $entityId, $attributes = [])
10801080
{
1081-
$this->_attributes = [];
10821081
$select = $this->_getLoadRowSelect($object, $entityId);
10831082
$row = $this->getConnection()->fetchRow($select);
10841083

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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="AdminCreateSimpleProductActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="category"/>
17+
<argument name="simpleProduct"/>
18+
</arguments>
19+
20+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
21+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
22+
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
23+
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
24+
<fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
25+
<fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
26+
<fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
27+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/>
28+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
29+
<fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
30+
31+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
32+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
33+
<seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/>
34+
<seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/>
35+
<seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/>
36+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/>
37+
<seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/>
38+
</actionGroup>
39+
</actionGroups>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<useCaseId value="MC-32763"/>
1919
<group value="catalog"/>
2020
<group value="widget"/>
21+
<skip>
22+
<issueId value="MC-34091"/>
23+
</skip>
2124
</annotations>
2225
<before>
2326
<!-- Set Stores > Configurations > Catalog > Recently Viewed/Compared Products > Show for Current = Website -->

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
</after>
4242

4343
<!-- Login Customer Storefront -->
44-
45-
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/>
46-
<fillField userInput="$$createCustomer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
47-
<fillField userInput="$$createCustomer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
48-
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
44+
<actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage"/>
45+
<actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials">
46+
<argument name="customer" value="$$createCustomer$$"/>
47+
</actionGroup>
48+
<actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButton" />
4949

5050
<!-- Checking the correctness of displayed prices for user parameters -->
5151

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ Stock,Stock
7070
"Use Config Settings","Use Config Settings"
7171
"Qty Uses Decimals","Qty Uses Decimals"
7272
"Allow Multiple Boxes for Shipping","Allow Multiple Boxes for Shipping"
73+
"Done","Done"

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<options>
1212
<option name="buttons" xsi:type="array">
1313
<item name="0" xsi:type="array">
14-
<item name="text" xsi:type="string">Done</item>
14+
<item name="text" xsi:type="string" translate="true">Done</item>
1515
<item name="class" xsi:type="string">action-primary</item>
1616
<item name="actions" xsi:type="array">
1717
<item name="0" xsi:type="array">
@@ -21,7 +21,7 @@
2121
</item>
2222
</item>
2323
</option>
24-
<option name="title" xsi:type="string">Advanced Inventory</option>
24+
<option name="title" xsi:type="string" translate="true">Advanced Inventory</option>
2525
</options>
2626
<onCancel>actionDone</onCancel>
2727
<dataScope>data.product</dataScope>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontAssertUnableSearchNegativeForPriceFieldActionGroup" extends="StorefrontFillFormAdvancedSearchActionGroup">
12+
<remove keyForRemoval="waitForPageLoad" />
13+
<grabTextFrom selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFromError}}" stepKey="grabPriceFromError"/>
14+
<grabTextFrom selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceToError}}" stepKey="grabPriceToError"/>
15+
<assertEquals stepKey="assertErrorMessagePriceFrom">
16+
<actualResult type="string">{{UnableNegativePrice.Error_message}}</actualResult>
17+
<expectedResult type="string">$grabPriceFromError</expectedResult>
18+
</assertEquals>
19+
<assertEquals stepKey="assertErrorMessagePriceTo">
20+
<actualResult type="string">{{UnableNegativePrice.Error_message}}</actualResult>
21+
<expectedResult type="string">$grabPriceToError</expectedResult>
22+
</assertEquals>
23+
</actionGroup>
24+
</actionGroups>

app/code/Magento/CatalogSearch/Test/Mftf/Data/MinMaxQueryLengthHintsData.xml renamed to app/code/Magento/CatalogSearch/Test/Mftf/Data/MessageAndHintData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
<entity name="MinMaxQueryLength" type="constant">
1212
<data key="Hint">This value must be compatible with the corresponding setting in the configured search engine</data>
1313
</entity>
14+
<entity name="UnableNegativePrice" type="constant">
15+
<data key="Error_message">Please enter a number 0 or greater in this field.</data>
16+
</entity>
1417
</entities>

app/code/Magento/CatalogSearch/Test/Mftf/Section/StorefrontCatalogSearchAdvancedFormSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<element name="ShortDescription" type="input" selector="#short_description"/>
1717
<element name="PriceFrom" type="input" selector="#price"/>
1818
<element name="PriceTo" type="input" selector="#price_to"/>
19+
<element name="PriceFromError" type="text" selector="#price-error"/>
20+
<element name="PriceToError" type="text" selector="#price_to-error"/>
1921
<element name="AttributeByCode" type="input" selector="#{{var1}}" parameterized="true"/>
2022
<element name="SubmitButton" type="button" selector="//*[@id='form-validate']//button[@type='submit']"/>
2123
</section>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="StorefrontCheckUnableAdvancedSearchWithNegativePriceTest">
12+
<annotations>
13+
<stories value="Use Advanced Search"/>
14+
<title value="Unable negative price use to advanced search"/>
15+
<description value="Check unable negative price use to advanced search by price from and price to"/>
16+
</annotations>
17+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefront"/>
18+
<actionGroup ref="StorefrontOpenAdvancedSearchActionGroup" stepKey="openAdvancedSearch"/>
19+
<actionGroup ref="StorefrontAssertUnableSearchNegativeForPriceFieldActionGroup" stepKey="assertUnableSearch">
20+
<argument name="price_to" value="-50"/>
21+
<argument name="price_from" value="-10"/>
22+
</actionGroup>
23+
</test>
24+
</tests>

app/code/Magento/CatalogSearch/view/frontend/templates/advanced/form.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
8+
// @codingStandardsIgnoreFile
89
?>
910
<?php
1011
/**
@@ -68,7 +69,7 @@
6869
class="input-text"
6970
type="text"
7071
maxlength="<?= $block->escapeHtmlAttr($maxQueryLength) ?>"
71-
data-validate="{number:true, 'less-than-equals-to':'#<?= $block->escapeHtmlAttr($_code) ?>_to'}" />
72+
data-validate="{number:true, 'validate-not-negative-number':true, 'less-than-equals-to':'#<?= $block->escapeHtmlAttr($_code) ?>_to'}" />
7273
</div>
7374
</div>
7475
<div class="field with-addon no-label">
@@ -81,7 +82,7 @@
8182
class="input-text"
8283
type="text"
8384
maxlength="<?= $block->escapeHtmlAttr($maxQueryLength) ?>"
84-
data-validate="{number:true, 'greater-than-equals-to':'#<?= $block->escapeHtmlAttr($_code) ?>'}" />
85+
data-validate="{number:true, 'validate-not-negative-number':true, 'greater-than-equals-to':'#<?= $block->escapeHtmlAttr($_code) ?>'}" />
8586
<label class="addafter"
8687
for="<?= $block->escapeHtmlAttr($_code) ?>_to">
8788
<?= $block->escapeHtml($block->getCurrency($_attribute)) ?>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminDeleteCmsPageFromGridActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<click selector="{{CmsPagesPageActionsSection.select(urlKey)}}" stepKey="clickSelect"/>
16+
<click selector="{{CmsPagesPageActionsSection.delete(urlKey)}}" stepKey="clickDelete"/>
17+
<waitForElementVisible selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="waitForOkButtonToBeVisible"/>
18+
<click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="clickOkButton"/>
19+
<waitForPageLoad stepKey="waitForPageLoad3"/>
20+
</actionGroup>
21+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSearchCmsPageInGridByUrlKeyActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<click selector="{{CmsPagesPageActionsSection.filterButton}}" stepKey="clickFilterButton"/>
16+
<fillField selector="{{CmsPagesPageActionsSection.URLKey}}" userInput="{{urlKey}}" stepKey="fillUrlKeyField"/>
17+
<click selector="{{CmsPagesPageActionsSection.ApplyFiltersBtn}}" stepKey="clickApplyFiltersButton"/>
18+
<waitForPageLoad stepKey="waitForPageLoading"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 17 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminCmsPageIsNotInGridActionGroup">
12+
<arguments>
13+
<argument name="urlKey" type="string"/>
14+
</arguments>
15+
<dontSee userInput="{{urlKey}}" selector="{{CmsPagesPageActionsSection.gridDataRow}}" stepKey="dontSeeCmsPageInGrid"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
<element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" />
3131
<element name="massActionsButton" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[contains(@class, 'action-select')]" />
3232
<element name="massActionsOption" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//span[contains(@class, 'action-menu-item') and .= '{{action}}']" parameterized="true"/>
33+
<element name="gridDataRow" type="input" selector=".data-row .data-grid-cell-content"/>
3334
</section>
3435
</sections>

0 commit comments

Comments
 (0)