Skip to content

Commit 303839d

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-49481' into Troll_S53
2 parents 8fd3e8a + f5af34d commit 303839d

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

app/code/Magento/Eav/Model/ResourceModel/UpdateHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public function execute($entityType, $data)
134134
if ((!array_key_exists($attribute->getAttributeCode(), $snapshot)
135135
|| $snapshot[$attribute->getAttributeCode()] === false)
136136
&& array_key_exists($attribute->getAttributeCode(), $data)
137+
&& $data[$attribute->getAttributeCode()] !== false
137138
&& !$attribute->isValueEmpty($data[$attribute->getAttributeCode()])
138139
) {
139140
$this->attributePersistor->registerInsert(
@@ -147,6 +148,7 @@ public function execute($entityType, $data)
147148
if (array_key_exists($attribute->getAttributeCode(), $snapshot)
148149
&& $snapshot[$attribute->getAttributeCode()] !== false
149150
&& array_key_exists($attribute->getAttributeCode(), $data)
151+
&& $data[$attribute->getAttributeCode()] !== false
150152
&& $snapshot[$attribute->getAttributeCode()] != $data[$attribute->getAttributeCode()]
151153
&& !$attribute->isValueEmpty($data[$attribute->getAttributeCode()])
152154
) {

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/CategoryTest.php

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,58 @@ public function testSuggestCategoriesActionNoSuggestions()
147147
public function saveActionDataProvider()
148148
{
149149
return [
150-
//'default values' removed from here. Should be fixed in MAGETWO-49481
150+
'default values' => [
151+
[
152+
'id' => '2',
153+
'entity_id' => '2',
154+
'path' => '1/2',
155+
'url_key' => 'default-category',
156+
'is_anchor' => false,
157+
'use_default' => [
158+
'name' => 1,
159+
'is_active' => 1,
160+
'thumbnail' => 1,
161+
'description' => 1,
162+
'image' => 1,
163+
'meta_title' => 1,
164+
'meta_keywords' => 1,
165+
'meta_description' => 1,
166+
'include_in_menu' => 1,
167+
'display_mode' => 1,
168+
'landing_page' => 1,
169+
'available_sort_by' => 1,
170+
'default_sort_by' => 1,
171+
'filter_price_range' => 1,
172+
'custom_apply_to_products' => 1,
173+
'custom_design' => 1,
174+
'custom_design_from' => 1,
175+
'custom_design_to' => 1,
176+
'page_layout' => 1,
177+
'custom_layout_update' => 1,
178+
],
179+
],
180+
[
181+
'name' => false,
182+
'default_sort_by' => false,
183+
'display_mode' => false,
184+
'meta_title' => false,
185+
'custom_design' => false,
186+
'page_layout' => false,
187+
'is_active' => false,
188+
'include_in_menu' => false,
189+
'landing_page' => false,
190+
'is_anchor' => false,
191+
'custom_apply_to_products' => false,
192+
'available_sort_by' => false,
193+
'description' => false,
194+
'meta_keywords' => false,
195+
'meta_description' => false,
196+
'custom_layout_update' => false,
197+
'custom_design_from' => false,
198+
'custom_design_to' => false,
199+
'filter_price_range' => false
200+
],
201+
],
151202
'custom values' => [
152203
[
153204
'id' => '2',
@@ -163,7 +214,7 @@ public function saveActionDataProvider()
163214
'url_key' => 'default-category',
164215
'display_mode' => 'PRODUCTS',
165216
'landing_page' => '1',
166-
'is_anchor' => '1',
217+
'is_anchor' => true,
167218
'custom_apply_to_products' => '0',
168219
'custom_design' => 'Magento/blank',
169220
'custom_design_from' => '5/21/2015',
@@ -232,7 +283,7 @@ public function saveActionDataProvider()
232283
'url_key' => 'default-category',
233284
'display_mode' => 'PRODUCTS',
234285
'landing_page' => '1',
235-
'is_anchor' => '1',
286+
'is_anchor' => true,
236287
'custom_apply_to_products' => '0',
237288
'custom_design' => 'Magento/blank',
238289
'custom_design_from' => '5/29/2015',

0 commit comments

Comments
 (0)