Skip to content

Commit dfc68f9

Browse files
committed
MAGETWO-52737: Deleting category's image on custom store view - deletes category's images for all store views
1 parent f7eec04 commit dfc68f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function _filterCategoryPostData(array $rawData)
8282
$data = $rawData;
8383
// @todo It is a workaround to prevent saving this data in category model and it has to be refactored in future
8484
if (isset($data['image']) && is_array($data['image'])) {
85-
if (is_array($data['image']) && !empty($data['image']['delete'])) {
85+
if (!empty($data['image']['delete'])) {
8686
$data['image'] = null;
8787
} else {
8888
if (isset($data['image'][0]['name']) && isset($data['image'][0]['tmp_name'])) {

app/code/Magento/Catalog/Model/CategoryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
9191
);
9292

9393
if (isset($existingData['image']) && is_array($existingData['image'])) {
94-
if (is_array($existingData['image']) && !empty($existingData['image']['delete'])) {
94+
if (!empty($existingData['image']['delete'])) {
9595
$existingData['image'] = null;
9696
} else {
9797
if (isset($existingData['image'][0]['name']) && isset($existingData['image'][0]['tmp_name'])) {

0 commit comments

Comments
 (0)