Skip to content

Commit 3ce7efd

Browse files
committed
#8590: M2.1.4 : ArrayBackend cannot save
1 parent 16bbf9d commit 3ce7efd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/Backend/ArrayBackend.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ public function beforeSave($object)
2323
$attributeCode = $this->getAttribute()->getAttributeCode();
2424
$data = $object->getData($attributeCode);
2525
if (is_array($data)) {
26-
$data = array_filter($data);
26+
$data = array_filter($data, function ($value) {
27+
return $value === '0' || !empty($value);
28+
});
2729
$object->setData($attributeCode, implode(',', $data));
2830
}
2931

0 commit comments

Comments
 (0)