Skip to content

Commit 952b098

Browse files
author
Oleksandr Dubovyk
committed
MAGETWO-92907: Category image on custom Store View level disappears and appears after every save
1 parent e758b7f commit 952b098

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
@@ -99,7 +99,7 @@ public function beforeSave($object)
9999
$object->setData($this->additionalData . $attributeName, $value);
100100
$object->setData($attributeName, $imageName);
101101
} elseif (!is_string($value)) {
102-
$object->setData($attributeName, '');
102+
$object->setData($attributeName, null);
103103
}
104104

105105
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
@@ -88,7 +88,7 @@ public function testBeforeSaveValueDeletion($value)
8888

8989
$model->beforeSave($object);
9090

91-
$this->assertEquals('', $object->getTestAttribute());
91+
$this->assertEquals(null, $object->getTestAttribute());
9292
}
9393

9494
/**

0 commit comments

Comments
 (0)