Skip to content

Commit 3152b80

Browse files
author
Oleksandr Dubovyk
committed
MAGETWO-93982: Category image on custom Store View level disappears and appears after every save
1 parent 8c227d5 commit 3152b80

File tree

2 files changed

+2
-2
lines changed
  • app/code/Magento/Catalog

2 files changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function beforeSave($object)
106106
$object->setData($this->additionalData . $attributeName, $value);
107107
$object->setData($attributeName, $imageName);
108108
} elseif (!is_string($value)) {
109-
$object->setData($attributeName, '');
109+
$object->setData($attributeName, null);
110110
}
111111

112112
return parent::beforeSave($object);

app/code/Magento/Catalog/Test/Unit/Model/Category/Attribute/Backend/ImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testBeforeSaveValueDeletion($value)
9898

9999
$model->beforeSave($object);
100100

101-
$this->assertEquals('', $object->getTestAttribute());
101+
$this->assertEquals(null, $object->getTestAttribute());
102102
}
103103

104104
/**

0 commit comments

Comments
 (0)