Skip to content

Commit dd5af3d

Browse files
Merge remote-tracking branch 'mainline/2.3-develop' into feature/issue-21380
2 parents 7859a2f + 5177344 commit dd5af3d

File tree

410 files changed

+14340
-4547
lines changed

Some content is hidden

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

410 files changed

+14340
-4547
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Magento 2 development team or community maintainers will review all issues a
1111
During the review we might require clarifications from the contributor.
1212
If there is no response from the contributor within two weeks, the pull request will be closed.
1313

14-
For more detialed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
14+
For more detailed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
1515

1616
## Contribution requirements
1717

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\AdminNotification\Model;
77

8+
use Magento\Framework\Escaper;
9+
use Magento\Framework\App\ObjectManager;
810
use Magento\Framework\Config\ConfigOptionsListConstants;
911

1012
/**
@@ -26,7 +28,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
2628
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2729

2830
/**
29-
* @var \Magento\Framework\Escaper
31+
* @var Escaper
3032
*/
3133
private $escaper;
3234

@@ -82,7 +84,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
8284
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
8385
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
8486
* @param array $data
85-
* @param \Magento\Framework\Escaper|null $escaper
87+
* @param Escaper|null $escaper
8688
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8789
*/
8890
public function __construct(
@@ -97,7 +99,7 @@ public function __construct(
9799
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
98100
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
99101
array $data = [],
100-
\Magento\Framework\Escaper $escaper = null
102+
Escaper $escaper = null
101103
) {
102104
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
103105
$this->_backendConfig = $backendConfig;
@@ -106,8 +108,8 @@ public function __construct(
106108
$this->_deploymentConfig = $deploymentConfig;
107109
$this->productMetadata = $productMetadata;
108110
$this->urlBuilder = $urlBuilder;
109-
$this->escaper = $escaper ?? \Magento\Framework\App\ObjectManager::getInstance()->get(
110-
\Magento\Framework\Escaper::class
111+
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(
112+
Escaper::class
111113
);
112114
}
113115

app/code/Magento/AuthorizenetGraphQl/Model/AuthorizenetDataProvider.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99

1010
use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface;
1111
use Magento\Framework\Stdlib\ArrayManager;
12-
use Magento\Framework\GraphQL\DataObjectConverter;
1312

1413
/**
1514
* DataProvider Model for Authorizenet
1615
*/
1716
class AuthorizenetDataProvider implements AdditionalDataProviderInterface
1817
{
19-
private const PATH_ADDITIONAL_DATA = 'input/payment_method/additional_data/authorizenet_acceptjs';
18+
private const PATH_ADDITIONAL_DATA = 'authorizenet_acceptjs';
2019

2120
/**
2221
* @var ArrayManager
@@ -36,12 +35,12 @@ public function __construct(
3635
/**
3736
* Return additional data
3837
*
39-
* @param array $args
38+
* @param array $data
4039
* @return array
4140
*/
42-
public function getData(array $args): array
41+
public function getData(array $data): array
4342
{
44-
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $args) ?? [];
43+
$additionalData = $this->arrayManager->get(static::PATH_ADDITIONAL_DATA, $data) ?? [];
4544
foreach ($additionalData as $key => $value) {
4645
$additionalData[$this->snakeCaseToCamelCase($key)] = $value;
4746
unset($additionalData[$key]);

app/code/Magento/Backend/Test/Mftf/Section/AdminHeaderSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
1414
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
1515
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
16+
<!-- Used for page not found error -->
17+
<element name="pageNotFoundTitle" type="text" selector=".page-title span"/>
1618
</section>
1719
</sections>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginTest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
<group value="login"/>
2121
</annotations>
2222

23-
<amOnPage url="{{AdminLoginPage.url}}" stepKey="amOnAdminLoginPage"/>
24-
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
25-
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
26-
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickOnSignIn"/>
27-
<closeAdminNotification stepKey="closeAdminNotification"/>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2824
<seeInCurrentUrl url="{{AdminLoginPage.url}}" stepKey="seeAdminLoginUrl"/>
25+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
2926
</test>
3027
</tests>

app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3232
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3333
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
35+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
3436
<actionGroup ref="logout" stepKey="logout"/>
3537
</after>
3638
<!-- go to bundle product creation page-->

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3333
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3434
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
35+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
36+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
3537
<actionGroup ref="logout" stepKey="logout"/>
3638
</after>
3739
<!-- go to bundle product creation page-->

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
*/
1313
namespace Magento\Catalog\Block\Adminhtml\Product;
1414

15+
use Magento\Framework\Escaper;
16+
1517
/**
1618
* Class Edit
1719
*/
1820
class Edit extends \Magento\Backend\Block\Widget
1921
{
2022
/**
21-
* @var \Magento\Framework\Escaper
23+
* @var Escaper
2224
*/
2325
private $escaper;
2426

@@ -55,7 +57,7 @@ class Edit extends \Magento\Backend\Block\Widget
5557
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
5658
* @param \Magento\Framework\Registry $registry
5759
* @param \Magento\Catalog\Helper\Product $productHelper
58-
* @param \Magento\Framework\Escaper $escaper
60+
* @param Escaper $escaper
5961
* @param array $data
6062
*/
6163
public function __construct(
@@ -64,7 +66,7 @@ public function __construct(
6466
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
6567
\Magento\Framework\Registry $registry,
6668
\Magento\Catalog\Helper\Product $productHelper,
67-
\Magento\Framework\Escaper $escaper,
69+
Escaper $escaper,
6870
array $data = []
6971
) {
7072
$this->_productHelper = $productHelper;

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Catalog\Model\Product\Attribute\Source\Status;
12+
use Magento\Framework\EntityManager\MetadataPool;
1213
use Magento\Store\Model\Store;
1314

1415
/**
@@ -31,19 +32,28 @@ class Eraser
3132
*/
3233
protected $storeManager;
3334

35+
/**
36+
* @var MetadataPool
37+
*/
38+
private $metadataPool;
39+
3440
/**
3541
* @param \Magento\Framework\App\ResourceConnection $resource
3642
* @param \Magento\Catalog\Helper\Product\Flat\Indexer $productHelper
3743
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
44+
* @param MetadataPool|null $metadataPool
3845
*/
3946
public function __construct(
4047
\Magento\Framework\App\ResourceConnection $resource,
4148
\Magento\Catalog\Helper\Product\Flat\Indexer $productHelper,
42-
\Magento\Store\Model\StoreManagerInterface $storeManager
49+
\Magento\Store\Model\StoreManagerInterface $storeManager,
50+
MetadataPool $metadataPool = null
4351
) {
4452
$this->productIndexerHelper = $productHelper;
4553
$this->connection = $resource->getConnection();
4654
$this->storeManager = $storeManager;
55+
$this->metadataPool = $metadataPool ?:
56+
\Magento\Framework\App\ObjectManager::getInstance()->get(MetadataPool::class);
4757
}
4858

4959
/**
@@ -81,17 +91,24 @@ public function removeDisabledProducts(array &$ids, $storeId)
8191
/* @var $statusAttribute \Magento\Eav\Model\Entity\Attribute */
8292
$statusAttribute = $this->productIndexerHelper->getAttribute('status');
8393

94+
/** @var \Magento\Framework\EntityManager\EntityMetadataInterface $metadata */
95+
$metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class);
96+
8497
$select = $this->getSelectForProducts($ids);
8598
$select->joinLeft(
8699
['status_global_attr' => $statusAttribute->getBackendTable()],
87100
' status_global_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
88-
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID,
101+
. ' AND status_global_attr.store_id = ' . Store::DEFAULT_STORE_ID
102+
. ' AND status_global_attr.' . $statusAttribute->getEntityIdField() . '='
103+
. 'product_table.' . $metadata->getLinkField(),
89104
[]
90105
);
91106
$select->joinLeft(
92107
['status_attr' => $statusAttribute->getBackendTable()],
93108
' status_attr.attribute_id = ' . (int)$statusAttribute->getAttributeId()
94-
. ' AND status_attr.store_id = ' . $storeId,
109+
. ' AND status_attr.store_id = ' . $storeId
110+
. ' AND status_attr.' . $statusAttribute->getEntityIdField() . '='
111+
. 'product_table.' . $metadata->getLinkField(),
95112
[]
96113
);
97114
$select->where('IFNULL(status_attr.value, status_global_attr.value) = ?', Status::STATUS_DISABLED);

app/code/Magento/Catalog/Model/ResourceModel/Product/Image.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ private function getUsedImagesSelect(): Select
158158
'value as filepath'
159159
)->joinInner(
160160
['image_value' => $this->resourceConnection->getTableName(Gallery::GALLERY_VALUE_TABLE)],
161-
'images.value_id = image_value.value_id'
161+
'images.value_id = image_value.value_id',
162+
[]
162163
)->where(
163164
'images.disabled = 0 AND image_value.disabled = 0'
164165
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminFillProductAttributePropertiesActionGroup">
11+
<arguments>
12+
<argument name="attributeName" type="string"/>
13+
<argument name="attributeType" type="string"/>
14+
</arguments>
15+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
16+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/>
17+
</actionGroup>
18+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenAttributeSetByNameActionGroup">
11+
<arguments>
12+
<argument name="attributeSetName" type="string" defaultValue="Default"/>
13+
</arguments>
14+
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName(attributeSetName)}}" stepKey="chooseAttributeSet"/>
15+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenAttributeSetGridPageActionGroup">
11+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
12+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenProductAttributePageActionGroup">
11+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToAttributePage"/>
12+
<waitForPageLoad stepKey="waitForAttributePageLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenProductIndexPageActionGroup">
11+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndexPage"/>
12+
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertStorefrontCustomProductAttributeActionGroup">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
<argument name="attributeValue" type="string"/>
14+
</arguments>
15+
<see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.customAttributeLabel(attributeLabel)}}" stepKey="seeAttributeLabel" />
16+
<see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.customAttributeValue(attributeLabel)}}" stepKey="seeAttributeValue" />
17+
</actionGroup>
18+
</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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="OpenStorefrontProductPageByProductNameActionGroup">
11+
<arguments>
12+
<argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/>
13+
</arguments>
14+
<amOnPage url="{{productName}}.html" stepKey="amOnProductPage"/>
15+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,11 @@
110110
<data key="is_active">false</data>
111111
<data key="include_in_menu">false</data>
112112
</entity>
113+
<!-- Category from file "prepared-for-sample-data.csv"-->
114+
<entity name="Gear" type="category">
115+
<data key="name">Gear</data>
116+
<data key="name_lwr">gear</data>
117+
<data key="is_active">true</data>
118+
<data key="include_in_menu">true</data>
119+
</entity>
113120
</entities>

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,27 @@
320320
<data key="option1_admin" unique="suffix">opt1'Admin</data>
321321
<data key="option1_frontend" unique="suffix">opt1'Front</data>
322322
</entity>
323+
<entity name="productTextEditorAttribute" type="ProductAttribute">
324+
<data key="attribute_code" unique="suffix">attribute</data>
325+
<data key="frontend_input">texteditor</data>
326+
<data key="scope">global</data>
327+
<data key="is_required">false</data>
328+
<data key="is_unique">false</data>
329+
<data key="is_searchable">true</data>
330+
<data key="is_visible">true</data>
331+
<data key="backend_type">text</data>
332+
<data key="is_wysiwyg_enabled">true</data>
333+
<data key="is_visible_in_advanced_search">true</data>
334+
<data key="is_visible_on_front">true</data>
335+
<data key="is_filterable">true</data>
336+
<data key="is_filterable_in_search">true</data>
337+
<data key="used_in_product_listing">true</data>
338+
<data key="is_used_for_promo_rules">true</data>
339+
<data key="is_comparable">true</data>
340+
<data key="is_used_in_grid">true</data>
341+
<data key="is_visible_in_grid">true</data>
342+
<data key="is_filterable_in_grid">true</data>
343+
<data key="used_for_sort_by">true</data>
344+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
345+
</entity>
323346
</entities>

0 commit comments

Comments
 (0)