Skip to content

Commit 8ba1b79

Browse files
authored
Merge branch '2.4-develop' into no-author/url-user-variable-weee
2 parents 1510781 + a047c76 commit 8ba1b79

File tree

230 files changed

+4484
-4267
lines changed

Some content is hidden

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

230 files changed

+4484
-4267
lines changed

app/code/Magento/Backend/Block/System/Store/Grid/Render/Group.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Block\System\Store\Grid\Render;
77

8+
use Magento\Framework\DataObject;
9+
810
/**
911
* Store render group
1012
*
@@ -13,9 +15,9 @@
1315
class Group extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
1416
{
1517
/**
16-
* {@inheritdoc}
18+
* @inheritDoc
1719
*/
18-
public function render(\Magento\Framework\DataObject $row)
20+
public function render(DataObject $row)
1921
{
2022
if (!$row->getData($this->getColumn()->getIndex())) {
2123
return null;
@@ -28,6 +30,6 @@ public function render(\Magento\Framework\DataObject $row)
2830
'">' .
2931
$this->escapeHtml($row->getData($this->getColumn()->getIndex())) .
3032
'</a><br />'
31-
. '(' . __('Code') . ': ' . $row->getGroupCode() . ')';
33+
. '(' . __('Code') . ': ' . $this->escapeHtml($row->getGroupCode()) . ')';
3234
}
3335
}

app/code/Magento/Backend/Block/Widget/Grid/Extended.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,10 +1067,11 @@ public function getCsv()
10671067
$data = [];
10681068
foreach ($this->getColumns() as $column) {
10691069
if (!$column->getIsSystem()) {
1070+
$exportField = (string)$column->getRowFieldExport($item);
10701071
$data[] = '"' . str_replace(
10711072
['"', '\\'],
10721073
['""', '\\\\'],
1073-
$column->getRowFieldExport($item) ?: ''
1074+
$exportField ?: ''
10741075
) . '"';
10751076
}
10761077
}

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,10 @@
349349
<field id="transport">smtp</field>
350350
</depends>
351351
</field>
352-
<field id="password" translate="label comment" type="password" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
352+
<field id="password" translate="label comment" type="obscure" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
353353
<label>Password</label>
354-
<comment>Username</comment>
354+
<comment>Password</comment>
355+
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
355356
<depends>
356357
<field id="transport">smtp</field>
357358
</depends>

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class Bundle extends AbstractView
3636
protected $options;
3737

3838
/**
39-
* Catalog product
40-
*
4139
* @var \Magento\Catalog\Helper\Product
4240
*/
4341
protected $catalogProduct;
@@ -405,7 +403,7 @@ private function getConfigData(Product $product, array $options)
405403
*/
406404
private function processOptions(string $optionId, array $options, DataObject $preConfiguredValues)
407405
{
408-
$preConfiguredQtys = $preConfiguredValues->getData("bundle_option_qty/${optionId}") ?? [];
406+
$preConfiguredQtys = $preConfiguredValues->getData("bundle_option_qty/{$optionId}") ?? [];
409407
$selections = $options[$optionId]['selections'];
410408
array_walk(
411409
$selections,

app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
<data key="is_active">true</data>
3232
<data key="include_in_menu">true</data>
3333
</entity>
34+
<entity name="SimpleSubCat" type="category">
35+
<data key="name" unique="suffix">SubCat</data>
36+
<data key="name_lwr" unique="suffix">simplesubcategory</data>
37+
<data key="urlKey" unique="suffix">simplesubcategory</data>
38+
<data key="is_active">true</data>
39+
<data key="include_in_menu">true</data>
40+
</entity>
3441
<entity name="NewRootCategory" type="category">
3542
<data key="name" unique="suffix">NewRootCategory</data>
3643
<data key="name_lwr" unique="suffix">newrootcategory</data>
@@ -309,4 +316,4 @@
309316
<var key="category_id" entityKey="id" entityType="category"/>
310317
<var key="sku" entityKey="sku" entityType="product"/>
311318
</entity>
312-
</entities>
319+
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,29 @@
3131
<data key="used_for_sort_by">true</data>
3232
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
3333
</entity>
34+
<entity name="productAttributeLayered" type="ProductAttribute">
35+
<data key="attribute_code" unique="suffix">attribute</data>
36+
<data key="frontend_input">textarea</data>
37+
<data key="scope">global</data>
38+
<data key="is_required">false</data>
39+
<data key="is_unique">false</data>
40+
<data key="is_searchable">true</data>
41+
<data key="is_visible">true</data>
42+
<data key="backend_type">text</data>
43+
<data key="is_wysiwyg_enabled">true</data>
44+
<data key="is_visible_in_advanced_search">true</data>
45+
<data key="is_visible_on_front">true</data>
46+
<data key="is_filterable">true</data>
47+
<data key="is_filterable_in_search">true</data>
48+
<data key="used_in_product_listing">true</data>
49+
<data key="is_used_for_promo_rules">true</data>
50+
<data key="is_comparable">true</data>
51+
<data key="is_used_in_grid">true</data>
52+
<data key="is_visible_in_grid">true</data>
53+
<data key="is_filterable_in_grid">true</data>
54+
<data key="used_for_sort_by">true</data>
55+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
56+
</entity>
3457
<entity name="productAttributeWithTwoOptions" type="ProductAttribute">
3558
<data key="attribute_code" unique="suffix">attribute</data>
3659
<data key="frontend_input">select</data>
@@ -299,7 +322,7 @@
299322
<data key="frontend_input">date</data>
300323
<data key="is_required_admin">No</data>
301324
</entity>
302-
<entity name="dropdownProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
325+
<entity name="dropdownProductAttribute" extends="productAttributeLayered" type="ProductAttribute">
303326
<data key="frontend_input">select</data>
304327
<data key="frontend_input_admin">Dropdown</data>
305328
<data key="is_required_admin">No</data>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<element name="expandRootCategoryByName" type="button" selector="//div[@class='x-tree-root-node']/li/div/a/span[contains(., '{{categoryName}}')]/../../img[contains(@class, 'x-tree-elbow-end-plus')]" parameterized="true" timeout="30"/>
2424
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2525
<element name="expandCategoryByName" type="text" selector="//span[contains(text(),'{{categoryName}}')]/ancestor::div[contains(@class,'x-tree-node-el')]//img[contains(@class,'x-tree-elbow-end-plus') or contains(@class,'x-tree-elbow-plus')]" parameterized="true" timeout="30"/>
26-
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SimpleSubCategory') and contains(text(),'({{productCount}})')]" parameterized="true"/>
26+
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2727
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2828
</section>
2929
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributePropertiesSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/>
2626
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button" timeout="30"/>
2727
<element name="storefrontProperties" type="text" selector="//*[@id='product_attribute_tabs_front']/span[1]"/>
28-
28+
<element name="useInSearchResultsLayeredNavigation" type="select" selector="#is_filterable_in_search"/>
2929
<!-- Manage Options nth child-->
3030
<element name="dropdownNthOptionIsDefault" type="checkbox" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) .input-radio" parameterized="true"/>
3131
<element name="dropdownNthOptionAdmin" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(3) input" parameterized="true"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<element name="scopeColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_global')]"/>
2424
<element name="isSearchableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_searchable')]"/>
2525
<element name="isComparableColumn" type="text" selector="//div[@id='attributeGrid']//td[contains(@class,'a-center col-is_comparable')]"/>
26+
<element name="addSelected" type="button" selector="//*[contains(text(),'Add Selected')]" timeout="30"/>
2627
</section>
2728
</sections>
2829

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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="SavingCustomAttributeValuesUsingUITest">
12+
<annotations>
13+
<group value="Custom Attribute"/>
14+
<stories value="Create Customer Attribute with Multi Select Input Type"/>
15+
<title value="Saving custom attribute values using UI"/>
16+
<description value="Saving custom attribute values using UI"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-7325"/>
19+
</annotations>
20+
21+
<before>
22+
<!--Login as admin-->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
24+
<!-- Create Simple Product -->
25+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
26+
<!--Navigate to Stores > Attributes > Product.-->
27+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
28+
29+
<!--Create new Product Attribute as TextField, with code and default value.-->
30+
<actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute">
31+
<argument name="attribute" value="multiselectProductAttribute"/>
32+
</actionGroup>
33+
34+
<!--Navigate to Product Attribute, add Product Options and Save - 1-->
35+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1">
36+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
37+
</actionGroup>
38+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1">
39+
<argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/>
40+
<argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/>
41+
<argument name="row" value="1"/>
42+
</actionGroup>
43+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2">
44+
<argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/>
45+
<argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/>
46+
<argument name="row" value="2"/>
47+
</actionGroup>
48+
<actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption3">
49+
<argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/>
50+
<argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/>
51+
<argument name="row" value="3"/>
52+
</actionGroup>
53+
54+
<actionGroup ref="AdminSetProductAttributeUseInLayeredNavigationOptionActionGroup" stepKey="setDropdownUseInLayeredNavigationNoResults">
55+
<argument name="useInLayeredNavigationValue" value="Filterable (with results)"/>
56+
</actionGroup>
57+
<selectOption selector="{{AttributePropertiesSection.useInSearchResultsLayeredNavigation}}" userInput="Yes" stepKey="selectUseInLayeredNavigationOption"/>
58+
<click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/>
59+
60+
<magentoCron groups="index" stepKey="reindex"/>
61+
</before>
62+
<after>
63+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteFirstProduct"/>
64+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage">
65+
<argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/>
66+
</actionGroup>
67+
<click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/>
68+
<click stepKey="clickOk" selector="{{AttributeDeleteModalSection.confirm}}"/>
69+
<waitForPageLoad stepKey="waitForDeletion"/>
70+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
71+
<argument name="indices" value=""/>
72+
</actionGroup>
73+
<!--Log out-->
74+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/>
75+
</after>
76+
77+
<!-- Open created product for edit -->
78+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
79+
<argument name="productId" value="$createSimpleProduct.id$"/>
80+
</actionGroup>
81+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82+
83+
<click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/>
84+
<waitForPageLoad stepKey="waitForAttributeAdded"/>
85+
<!-- Filter By Attribute Label on Add Attribute Page -->
86+
<click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/>
87+
<fillField selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{multiselectProductAttribute.attribute_code}}" stepKey="fillAttrCodeField" />
88+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearchBtn" />
89+
<click stepKey="clickonFirstRow" selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}"/>
90+
<click stepKey="clickOnAddSelected" selector="{{AdminProductAttributeGridSection.addSelected}}"/>
91+
<waitForPageLoad stepKey="waitForAttributeAdded2"/>
92+
<!-- Expand 'Attributes' tab -->
93+
<actionGroup ref="AdminExpandProductAttributesTabActionGroup" stepKey="expandAttributesTab"/>
94+
<!-- Check created attribute presents in the 'Attributes' tab -->
95+
<seeElement selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" stepKey="assertAttributeIsPresentInTab"/>
96+
<!-- Select attribute options -->
97+
<selectOption selector="{{AdminProductAttributesSection.attributeDropdownByCode(multiselectProductAttribute.attribute_code)}}" userInput="{{multiselectProductAttribute.option1_admin}}" stepKey="selectProduct1AttributeOption"/>
98+
<!-- Save product -->
99+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
100+
<!-- Go to Storefront and search for product-->
101+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToFrontPage"/>
102+
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront">
103+
<argument name="phrase" value="$createSimpleProduct.name$"/>
104+
</actionGroup>
105+
<!-- Assert custom Attribute in Layered Navigation-->
106+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" stepKey="waitForAttributeVisible"/>
107+
<conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle(multiselectProductAttribute.attribute_code)}}" dependentSelector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" visible="false" stepKey="clickToExpandAttribute"/>
108+
<waitForElementVisible selector="{{StorefrontCategorySidebarSection.activeFilterOptions}}" stepKey="waitForAttributeOptionsVisible"/>
109+
<wait time="10" stepKey="Wait"/>
110+
<see selector="{{StorefrontCategorySidebarSection.filterOption}}" userInput="{{multiselectProductAttribute.option1_frontend}}" stepKey="seeOption2"/>
111+
</test>
112+
</tests>

app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function testMoveWhenCannotFindParentCategory(): void
214214
{
215215
$this->expectException('Magento\Framework\Exception\LocalizedException');
216216
$this->expectExceptionMessage('Sorry, but we can\'t find the new parent category you selected.');
217-
$this->markTestIncomplete('MAGETWO-31165');
217+
$this->markTestSkipped('MAGETWO-31165');
218218
$parentCategory = $this->createPartialMock(
219219
Category::class,
220220
['getId', 'setStoreId', 'load']
@@ -260,7 +260,7 @@ public function testMoveWhenParentCategoryIsSameAsChildCategory(): void
260260
$this->expectExceptionMessage(
261261
'We can\'t move the category because the parent category name matches the child category name.'
262262
);
263-
$this->markTestIncomplete('MAGETWO-31165');
263+
$this->markTestSkipped('MAGETWO-31165');
264264
$parentCategory = $this->createPartialMock(
265265
Category::class,
266266
['getId', 'setStoreId', 'load']

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/Product/Plugin/ImportTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Category/Plugin/ImportTest.php

Lines changed: 0 additions & 37 deletions
This file was deleted.

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ private function buildSearchCriteria(array $args, ResolveInfo $info): SearchCrit
186186
{
187187
$productFields = (array)$info->getFieldSelection(1);
188188
$includeAggregations = isset($productFields['filters']) || isset($productFields['aggregations']);
189-
$processedArgs = $this->argsSelection->process((string) $info->fieldName, $args);
189+
$fieldName = $info->fieldName ?? "";
190+
$processedArgs = $this->argsSelection->process((string) $fieldName, $args);
190191
$searchCriteria = $this->searchCriteriaBuilder->build($processedArgs, $includeAggregations);
191192

192193
return $searchCriteria;

0 commit comments

Comments
 (0)