Skip to content

Commit 9200f05

Browse files
author
Sergey Shvets
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-92355
2 parents 3d49bfb + 24d21b6 commit 9200f05

File tree

79 files changed

+2256
-437
lines changed

Some content is hidden

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

79 files changed

+2256
-437
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminPromptModalSection">
12+
<element name="promptField" type="input" selector="input[data-role='promptField']"/>
13+
<element name="modalOk" type="button" selector="aside.prompt .modal-footer button.action-accept" timeout="30"/>
14+
</section>
15+
</sections>

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function imagePreprocessing($data)
279279
continue;
280280
}
281281

282-
$data[$attributeCode] = false;
282+
$data[$attributeCode] = '';
283283
}
284284

285285
return $data;

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

Lines changed: 58 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -160,63 +160,74 @@ protected function createBaseLoadSelect($entityId, $storeId, $attributeId)
160160
public function createBatchBaseSelect($storeId, $attributeId)
161161
{
162162
$linkField = $this->metadata->getLinkField();
163+
$conn = $this->getConnection();
163164

164-
$positionCheckSql = $this->getConnection()->getCheckSql(
165+
$positionCheckSql = $conn->getCheckSql(
165166
'value.position IS NULL',
166167
'default_value.position',
167168
'value.position'
168169
);
169170

170171
$mainTableAlias = $this->getMainTableAlias();
171172

172-
$select = $this->getConnection()->select()->from(
173-
[$mainTableAlias => $this->getMainTable()],
174-
[
175-
'value_id',
176-
'file' => 'value',
177-
'media_type'
178-
]
179-
)->joinInner(
180-
['entity' => $this->getTable(self::GALLERY_VALUE_TO_ENTITY_TABLE)],
181-
$mainTableAlias . '.value_id = entity.value_id',
182-
[$linkField]
183-
)->joinLeft(
184-
['value' => $this->getTable(self::GALLERY_VALUE_TABLE)],
185-
implode(
186-
' AND ',
187-
[
188-
$mainTableAlias . '.value_id = value.value_id',
189-
$this->getConnection()->quoteInto('value.store_id = ?', (int)$storeId),
190-
'value.' . $linkField . ' = entity.' . $linkField,
191-
]
192-
),
193-
[]
194-
)->joinLeft(
195-
['default_value' => $this->getTable(self::GALLERY_VALUE_TABLE)],
196-
implode(
197-
' AND ',
173+
$storeCondition = $conn->quoteInto('value.store_id = ?', (int)$storeId);
174+
$defStoreCondition = $conn->quoteInto('default_value.store_id = ?', Store::DEFAULT_STORE_ID);
175+
$select = $conn->select()
176+
->from(
177+
[$mainTableAlias => $this->getMainTable()],
198178
[
199-
$mainTableAlias . '.value_id = default_value.value_id',
200-
$this->getConnection()->quoteInto('default_value.store_id = ?', Store::DEFAULT_STORE_ID),
201-
'default_value.' . $linkField . ' = entity.' . $linkField,
179+
'value_id',
180+
'file' => 'value',
181+
'media_type'
202182
]
203-
),
204-
[]
205-
)->columns([
206-
'label' => $this->getConnection()->getIfNullSql('`value`.`label`', '`default_value`.`label`'),
207-
'position' => $this->getConnection()->getIfNullSql('`value`.`position`', '`default_value`.`position`'),
208-
'disabled' => $this->getConnection()->getIfNullSql('`value`.`disabled`', '`default_value`.`disabled`'),
209-
'label_default' => 'default_value.label',
210-
'position_default' => 'default_value.position',
211-
'disabled_default' => 'default_value.disabled'
212-
])->where(
213-
$mainTableAlias . '.attribute_id = ?',
214-
$attributeId
215-
)->where(
216-
$mainTableAlias . '.disabled = 0'
217-
)->order(
218-
$positionCheckSql . ' ' . \Magento\Framework\DB\Select::SQL_ASC
219-
);
183+
)
184+
->joinInner(
185+
['entity' => $this->getTable(self::GALLERY_VALUE_TO_ENTITY_TABLE)],
186+
$mainTableAlias . '.value_id = entity.value_id',
187+
[$linkField]
188+
)
189+
->joinLeft(
190+
['value' => $this->getTable(self::GALLERY_VALUE_TABLE)],
191+
implode(
192+
' AND ',
193+
[
194+
$mainTableAlias . '.value_id = value.value_id',
195+
$storeCondition,
196+
'value.' . $linkField . ' = entity.' . $linkField,
197+
]
198+
),
199+
[]
200+
)
201+
->joinLeft(
202+
['default_value' => $this->getTable(self::GALLERY_VALUE_TABLE)],
203+
implode(
204+
' AND ',
205+
[
206+
$mainTableAlias . '.value_id = default_value.value_id',
207+
$defStoreCondition,
208+
'default_value.' . $linkField . ' = entity.' . $linkField,
209+
]
210+
),
211+
[]
212+
)
213+
->columns([
214+
'label' => $conn->getIfNullSql('`value`.`label`', '`default_value`.`label`'),
215+
'position' => $conn->getIfNullSql('`value`.`position`', '`default_value`.`position`'),
216+
'disabled' => $conn->getIfNullSql('`value`.`disabled`', '`default_value`.`disabled`'),
217+
'label_default' => 'default_value.label',
218+
'position_default' => 'default_value.position',
219+
'disabled_default' => 'default_value.disabled'
220+
])
221+
->where($mainTableAlias . '.attribute_id = ?', $attributeId)
222+
->where($mainTableAlias . '.disabled = 0');
223+
224+
// filter entities by store
225+
if ($storeId > 0) {
226+
$orWhere = $storeCondition . ' OR '. $defStoreCondition;
227+
$select->where($orWhere);
228+
}
229+
230+
$select->order($positionCheckSql . ' ' . \Magento\Framework\DB\Select::SQL_ASC);
220231

221232
return $select;
222233
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
11+
<!--Fill main fields in create product form with no weight, useful for virtual and downloadable products -->
12+
<actionGroup name="fillMainProductFormNoWeight">
13+
<arguments>
14+
<argument name="product" defaultValue="DownloadableProduct"/>
15+
</arguments>
16+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
17+
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
18+
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
19+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
20+
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
21+
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/>
22+
</actionGroup>
23+
24+
<!--Save product and see success message-->
25+
<actionGroup name="saveProductForm">
26+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
27+
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssignAttributeToGroup">
12+
<arguments>
13+
<argument name="group" type="string"/>
14+
<argument name="attribute" type="string"/>
15+
</arguments>
16+
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemAttributeGroup(group, '1')}}" stepKey="dragAndDropToGroupProductDetails"/>
19+
<waitForPageLoad stepKey="waitForPageLoad2"/>
20+
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
21+
</actionGroup>
22+
<actionGroup name="UnassignAttributeFromGroup">
23+
<arguments>
24+
<argument name="group" type="string"/>
25+
<argument name="attribute" type="string"/>
26+
</arguments>
27+
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
28+
<waitForPageLoad stepKey="waitForPageLoad1"/>
29+
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/>
30+
<waitForPageLoad stepKey="waitForPageLoad2"/>
31+
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
32+
</actionGroup>
33+
<actionGroup name="SaveAttributeSet">
34+
<click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/>
35+
<see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/>
36+
</actionGroup>
37+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!--Reset the product grid to the default view-->
12+
<actionGroup name="AdminResetProductGridToDefaultViewActionGroup">
13+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
14+
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
15+
<waitForElementVisible selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" time="10" stepKey="waitForViewBookmarkElementVisible"/>
16+
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
17+
<see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
18+
</actionGroup>
19+
</actionGroups>
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+
<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">
10+
<actionGroup name="CheckAttributeInAdditionalInformationTabActionGroup">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
<argument name="attributeValue" type="string"/>
14+
</arguments>
15+
<click selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" stepKey="clickTab"/>
16+
<see userInput="{{attributeLabel}}" selector=" {{StorefrontProductAdditionalInformationSection.attributeLabel}}" stepKey="seeAttributeLabel"/>
17+
<see userInput="{{attributeValue}}" selector="{{StorefrontProductAdditionalInformationSection.attributeValue}}" stepKey="seeAttributeValue"/>
18+
</actionGroup>
19+
</actionGroups>
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="CheckAttributeNotInAdditionalInformationTabActionGroup">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
</arguments>
14+
<conditionalClick selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" dependentSelector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" visible="true" stepKey="clickTab"/>
15+
<dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductAdditionalInformationSection.additionalInfoContainer}}" stepKey="dontSeeAttributeLabel"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<!-- Create a new attribute set -->
12+
<actionGroup name="CreateAttributeSetActionGroup">
13+
<arguments>
14+
<argument name="nameLabel" type="string"/>
15+
<argument name="basedOn" defaultValue="Default" type="string"/>
16+
</arguments>
17+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
18+
<waitForPageLoad stepKey="waitForPageLoad"/>
19+
<click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/>
20+
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{nameLabel}}" stepKey="fillName"/>
21+
<selectOption selector="{{AdminProductAttributeSetSection.basedOn}}" userInput="{{basedOn}}" stepKey="selectDefaultSet"/>
22+
<click selector="{{AdminProductAttributeSetSection.save}}" stepKey="clickSave"/>
23+
<see userInput="You saved the attribute set." selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
24+
</actionGroup>
25+
</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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateNewGroupInAttributeSetActionGroup">
12+
<arguments>
13+
<argument name="groupName" type="string" defaultValue="TestGroupName"/>
14+
</arguments>
15+
<click selector="{{AdminProductAttributeSetSection.addNewGroupBtn}}" stepKey="clickAddNewGroup"/>
16+
<waitForElementVisible selector="{{AdminPromptModalSection.promptField}}" stepKey="waitModalWindow"/>
17+
<fillField selector="{{AdminPromptModalSection.promptField}}" userInput="{{groupName}}" stepKey="fillNewGroupName"/>
18+
<click selector="{{AdminPromptModalSection.modalOk}}" stepKey="clickOkInModal"/>
19+
</actionGroup>
20+
</actionGroups>

0 commit comments

Comments
 (0)