Skip to content

Commit 5687704

Browse files
author
Vitaliy Boyko
committed
Merge branch '2.3-develop' of github.com:magento/magento2 into 20434-consider-url-rewrite-when-change-product-visibility-attribute-2-3
2 parents a8d1dc0 + 664a673 commit 5687704

File tree

225 files changed

+4633
-844
lines changed

Some content is hidden

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

225 files changed

+4633
-844
lines changed

app/code/Magento/Backend/Test/Mftf/Page/AdminDashboardPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminDashboardPage" url="admin/dashboard/" area="admin" module="Magento_Backend">
1212
<section name="AdminMenuSection"/>
1313
</page>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8+
89
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
1111
<actionGroup name="AdminOrderBraintreeFillActionGroup">
1212
<!--Select Braintree Payment method on Admin Order Create Page-->
1313
<click stepKey="chooseBraintree" selector="{{NewOrderSection.creditCardBraintree}}"/>
@@ -39,4 +39,4 @@
3939
<wait stepKey="waitForFillCVV" time="1"/>
4040
<switchToIFrame stepKey="switchBackFromCVV"/>
4141
</actionGroup>
42-
</actionGroups>
42+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
108

9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="GoToUserRoles">
1212
<click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/>
1313
<waitForPageLoad stepKey="waitForSystemsPageToOpen"/>
@@ -34,7 +34,6 @@
3434
<see userInput="You saved the role." stepKey="seeSuccessMessage" />
3535
</actionGroup>
3636

37-
3837
<!--Delete role-->
3938
<actionGroup name="AdminDeleteRoleActionGroup">
4039
<arguments>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
108

9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!--Go to all users-->
1212
<actionGroup name="GoToAllUsers">
1313
<click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/>
@@ -39,7 +39,6 @@
3939
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
4040
</actionGroup>
4141

42-
4342
<!--Delete User-->
4443
<actionGroup name="AdminDeleteNewUserActionGroup">
4544

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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminEditRoleInfoSection">
12+
<element name="roleName" type="input" selector="#role_name"/>
13+
<element name="password" type="input" selector="#current_password"/>
14+
<element name="roleResourcesTab" type="button" selector="#role_info_tabs_account"/>
15+
<element name="backButton" type="button" selector="button[title='Back']"/>
16+
<element name="resetButton" type="button" selector="button[title='Reset']"/>
17+
<element name="deleteButton" type="button" selector="button[title='Delete Role']"/>
18+
<element name="saveButton" type="button" selector="button[title='Save Role']"/>
19+
<element name="message" type="text" selector=".modal-popup.confirm div.modal-content"/>
20+
<element name="cancel" type="button" selector=".modal-popup.confirm button.action-dismiss"/>
21+
<element name="ok" type="button" selector=".modal-popup.confirm button.action-accept" timeout="60"/>
22+
</section>
23+
</sections>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminEditUserRoleSection">
12+
<element name="usernameTextField" type="input" selector="#user_username"/>
13+
<element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/>
14+
<element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/>
15+
<element name="resetButton" type="button" selector="button[title='Reset Filter']"/>
16+
<element name="roleNameInFirstRow" type="text" selector=".col-role_name"/>
17+
<element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/>
18+
</section>
19+
</sections>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminEditUserSection">
12+
<element name="system" type="input" selector="#menu-magento-backend-system"/>
13+
<element name="allUsers" type="input" selector="//span[contains(text(), 'All Users')]"/>
14+
<element name="create" type="input" selector="#add"/>
15+
<element name="usernameTextField" type="input" selector="#user_username"/>
16+
<element name="firstNameTextField" type="input" selector="#user_firstname"/>
17+
<element name="lastNameTextField" type="input" selector="#user_lastname"/>
18+
<element name="emailTextField" type="input" selector="#user_email"/>
19+
<element name="passwordTextField" type="input" selector="#user_password"/>
20+
<element name="pwConfirmationTextField" type="input" selector="#user_confirmation"/>
21+
<element name="currentPasswordField" type="input" selector="#user_current_password"/>
22+
<element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/>
23+
<element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/>
24+
<element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/>
25+
<element name="resetButton" type="button" selector="button[title='Reset Filter']"/>
26+
<element name="roleNameInFirstRow" type="text" selector=".col-role_name"/>
27+
<element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/>
28+
<element name="saveButton" type="button" selector="#save"/>
29+
</section>
30+
</sections>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminMenuSection">
12+
<element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/>
13+
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
14+
<element name="catalog" type="button" selector="//li[@id='menu-magento-catalog-catalog']"/>
15+
<element name="customers" type="button" selector="//li[@id='menu-magento-customer-customer']"/>
16+
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
17+
<element name="content" type="button" selector="//li[@id='menu-magento-backend-content']"/>
18+
<element name="reports" type="button" selector="//li[@id='menu-magento-reports-report']"/>
19+
<element name="stores" type="button" selector="//li[@id='menu-magento-backend-stores']"/>
20+
<element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/>
21+
<element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/>
22+
</section>
23+
</sections>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminRoleGridSection">
12+
<element name="idFilterTextField" type="input" selector="#roleGrid_filter_role_id"/>
13+
<element name="roleNameFilterTextField" type="input" selector="#roleGrid_filter_role_name"/>
14+
<element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/>
15+
<element name="resetButton" type="button" selector="button[title='Reset Filter']"/>
16+
<element name="roleNameInFirstRow" type="text" selector=".col-role_name"/>
17+
<element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/>
18+
</section>
19+
</sections>

app/code/Magento/Braintree/Test/Mftf/Section/BraintreeConfiguraionSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8+
89
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1011
<section name="BraintreeConfiguraionSection">
@@ -30,6 +31,5 @@
3031
<element name="actionAuthorize" type="text" selector="//select[@id='payment_us_braintree_section_braintree_braintree_paypal_payment_action']/option[text()='Authorize']"/>
3132
<element name="save" type="button" selector="//span[text()='Save Config']"/>
3233
<element name="successfulMessage" type="text" selector="//*[@data-ui-id='messages-message-success']"/>
33-
3434
</section>
35-
</sections>
35+
</sections>

app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationPaymentSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11-
<section name="ConfigurationPaymentSection">
11+
<section name="ConfigurationPaymentSection">
1212
<element name="configureButton" type="button" selector="//button[@id='payment_us_braintree_section_braintree-head']"/>
1313
</section>
1414
</sections>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StoresSubmenuSection">
12+
<element name="configuration" type="button" selector="//li[@id='menu-magento-backend-stores']//li[@data-ui-id='menu-magento-config-system-config']"/>
13+
</section>
14+
</sections>

app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(
6161
* Add parent id/sku pair to use for option filter at fetch time.
6262
*
6363
* @param int $parentId
64+
* @param int $parentEntityId
6465
* @param string $sku
6566
*/
6667
public function addParentFilterData(int $parentId, int $parentEntityId, string $sku) : void

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use Magento\Backend\Block\Template\Context;
1010
use Magento\Backend\Block\Widget\Accordion;
11-
use Magento\Backend\Block\Widget\Tabs as WigetTabs;
11+
use Magento\Backend\Block\Widget\Tabs as WidgetTabs;
1212
use Magento\Backend\Model\Auth\Session;
1313
use Magento\Catalog\Helper\Catalog;
1414
use Magento\Catalog\Helper\Data;
@@ -22,7 +22,7 @@
2222
* Admin product edit tabs
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2424
*/
25-
class Tabs extends WigetTabs
25+
class Tabs extends WidgetTabs
2626
{
2727
const BASIC_TAB_GROUP_CODE = 'basic';
2828

@@ -109,7 +109,7 @@ public function __construct(
109109
}
110110

111111
/**
112-
* @return void
112+
* @inheritdoc
113113
*/
114114
protected function _construct()
115115
{
@@ -119,6 +119,8 @@ protected function _construct()
119119
}
120120

121121
/**
122+
* Get group collection.
123+
*
122124
* @param int $attributeSetId
123125
* @return \Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\Collection
124126
*/
@@ -131,10 +133,11 @@ public function getGroupCollection($attributeSetId)
131133
}
132134

133135
/**
134-
* @return $this
136+
* @inheritdoc
135137
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
136-
* @SuppressWarnings(PHPMD.NPathComplexity)
137138
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
139+
* @SuppressWarnings(PHPMD.NPathComplexity)
140+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
138141
*/
139142
protected function _prepareLayout()
140143
{
@@ -315,6 +318,8 @@ public function getAttributeTabBlock()
315318
}
316319

317320
/**
321+
* Set attribute tab block.
322+
*
318323
* @param string $attributeTabBlock
319324
* @return $this
320325
*/
@@ -337,6 +342,8 @@ protected function _translateHtml($html)
337342
}
338343

339344
/**
345+
* Get accordion.
346+
*
340347
* @param string $parentTab
341348
* @return string
342349
*/

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
163163
{
164164
$adminValues = [];
165165
foreach ($optionsValues as $optionKey => $values) {
166-
if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
166+
if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
167167
$adminValues[] = reset($values);
168168
}
169169
}

app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ protected function duplicate($product)
318318

319319
$this->resourceModel->duplicate(
320320
$this->getAttribute()->getAttributeId(),
321-
isset($mediaGalleryData['duplicate']) ? $mediaGalleryData['duplicate'] : [],
321+
$mediaGalleryData['duplicate'] ?? [],
322322
$product->getOriginalLinkId(),
323323
$product->getData($this->metadata->getLinkField())
324324
);

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Catalog\Model\ResourceModel\Product;
78

89
use Magento\Store\Model\Store;
@@ -149,7 +150,7 @@ public function loadProductGalleryByAttributeId($product, $attributeId)
149150
*/
150151
protected function createBaseLoadSelect($entityId, $storeId, $attributeId)
151152
{
152-
$select = $this->createBatchBaseSelect($storeId, $attributeId);
153+
$select = $this->createBatchBaseSelect($storeId, $attributeId);
153154

154155
$select = $select->where(
155156
'entity.' . $this->metadata->getLinkField() . ' = ?',
@@ -378,9 +379,9 @@ public function deleteGalleryValueInStore($valueId, $entityId, $storeId)
378379
$conditions = implode(
379380
' AND ',
380381
[
381-
$this->getConnection()->quoteInto('value_id = ?', (int) $valueId),
382-
$this->getConnection()->quoteInto($this->metadata->getLinkField() . ' = ?', (int) $entityId),
383-
$this->getConnection()->quoteInto('store_id = ?', (int) $storeId)
382+
$this->getConnection()->quoteInto('value_id = ?', (int)$valueId),
383+
$this->getConnection()->quoteInto($this->metadata->getLinkField() . ' = ?', (int)$entityId),
384+
$this->getConnection()->quoteInto('store_id = ?', (int)$storeId)
384385
]
385386
);
386387

@@ -408,7 +409,7 @@ public function duplicate($attributeId, $newFiles, $originalProductId, $newProdu
408409

409410
$select = $this->getConnection()->select()->from(
410411
[$this->getMainTableAlias() => $this->getMainTable()],
411-
['value_id', 'value']
412+
['value_id', 'value', 'media_type', 'disabled']
412413
)->joinInner(
413414
['entity' => $this->getTable(self::GALLERY_VALUE_TO_ENTITY_TABLE)],
414415
$this->getMainTableAlias() . '.value_id = entity.value_id',
@@ -425,16 +426,16 @@ public function duplicate($attributeId, $newFiles, $originalProductId, $newProdu
425426

426427
// Duplicate main entries of gallery
427428
foreach ($this->getConnection()->fetchAll($select) as $row) {
428-
$data = [
429-
'attribute_id' => $attributeId,
430-
'value' => isset($newFiles[$row['value_id']]) ? $newFiles[$row['value_id']] : $row['value'],
431-
];
429+
$data = $row;
430+
$data['attribute_id'] = $attributeId;
431+
$data['value'] = $newFiles[$row['value_id']] ?? $row['value'];
432+
unset($data['value_id']);
432433

433434
$valueIdMap[$row['value_id']] = $this->insertGallery($data);
434435
$this->bindValueToEntity($valueIdMap[$row['value_id']], $newProductId);
435436
}
436437

437-
if (count($valueIdMap) == 0) {
438+
if (count($valueIdMap) === 0) {
438439
return [];
439440
}
440441

0 commit comments

Comments
 (0)