Skip to content

Commit b589187

Browse files
committed
MAGETWO-57145: [Backport] Unable to assign blank value to attribute #3545 #4910 #5485 - for 2.0
1 parent 54d4e70 commit b589187

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/options.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ define([
4242
data.intype = optionDefaultInputType;
4343
}
4444

45-
if (!this.totalItems) {
46-
data.checked = 'checked';
47-
}
4845
element = this.template({
4946
data: data
5047
});

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute/Options.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,16 @@
2222
<item name="admin" xsi:type="string">white</item>
2323
</field>
2424
</dataset>
25+
26+
<dataset name="two_options_no_default">
27+
<field name="0" xsi:type="array">
28+
<item name="is_default" xsi:type="string">No</item>
29+
<item name="admin" xsi:type="string">black</item>
30+
</field>
31+
<field name="1" xsi:type="array">
32+
<item name="is_default" xsi:type="string">No</item>
33+
<item name="admin" xsi:type="string">white</item>
34+
</field>
35+
</dataset>
2536
</repository>
2637
</config>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,30 @@
190190
<data name="productAttribute/data/is_comparable" xsi:type="string">Yes</data>
191191
<constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUnique" />
192192
</variation>
193+
<variation name="CreateProductAttributeEntityTestVariation10"
194+
summary="Create Product DropDown Attripute With No Selected Value" ticketId="MAGETWO-64025">
195+
<data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data>
196+
<data name="productAttribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data>
197+
<data name="productAttribute/data/frontend_input" xsi:type="string">Dropdown</data>
198+
<data name="productAttribute/data/options/dataset" xsi:type="string">two_options_no_default</data>
199+
<data name="productAttribute/data/is_required" xsi:type="string">No</data>
200+
<data name="productAttribute/data/attribute_code" xsi:type="string">attr_dropdown_%isolation%</data>
201+
<data name="productAttribute/data/is_global" xsi:type="string">Global</data>
202+
<data name="productAttribute/data/is_unique" xsi:type="string">No</data>
203+
<data name="productAttribute/data/is_searchable" xsi:type="string">Yes</data>
204+
<data name="productAttribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data>
205+
<data name="productAttribute/data/is_comparable" xsi:type="string">Yes</data>
206+
<data name="productAttribute/data/is_filterable" xsi:type="string">Filterable (with results)</data>
207+
<data name="productAttribute/data/is_filterable_in_search" xsi:type="string">Yes</data>
208+
<data name="productAttribute/data/is_html_allowed_on_front" xsi:type="string">Yes</data>
209+
<data name="productAttribute/data/is_visible_on_front" xsi:type="string">Yes</data>
210+
<data name="productAttribute/data/used_in_product_listing" xsi:type="string">Yes</data>
211+
<data name="productAttribute/data/used_for_sort_by" xsi:type="string">Yes</data>
212+
<data name="assertProduct/data/name" xsi:type="string">Product name</data>
213+
<data name="assertProduct/data/sku" xsi:type="string">product-sku</data>
214+
<data name="assertProduct/data/price" xsi:type="string">35</data>
215+
<constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid" />
216+
<constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm" />
217+
</variation>
193218
</testCase>
194219
</config>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd">
10+
<rule scope="testsuite">
11+
<allow>
12+
<class value="Magento\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest" />
13+
</allow>
14+
</rule>
15+
</config>

0 commit comments

Comments
 (0)