Skip to content

Commit 4be4600

Browse files
MC-40773: Custom Product Attribute Not Saving Blank If its 0
1 parent 2330cea commit 4be4600

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,29 @@ public function setupInputDataProvider()
216216
['description', null, 'descr text'],
217217
],
218218
],
219+
'update_product_with_empty_string_attribute' => [
220+
'requestProductData' => [
221+
'name' => 'testName3',
222+
'sku' => 'testSku3',
223+
'price' => '103',
224+
'special_price' => '100',
225+
'custom_attribute' => '',
226+
],
227+
'useDefaults' => [],
228+
'expectedProductData' => [
229+
'name' => 'testName3',
230+
'sku' => 'testSku3',
231+
'price' => '103',
232+
'special_price' => '100',
233+
'custom_attribute' => '',
234+
],
235+
'initialProductData' => [
236+
['name', null, 'testName2'],
237+
['sku', null, 'testSku2'],
238+
['price', null, '101'],
239+
['custom_attribute', null, '0'],
240+
],
241+
],
219242
];
220243
}
221244

0 commit comments

Comments
 (0)