Skip to content

Commit aa17e5f

Browse files
authored
MAGETWO-80717: Fix the correct removal of the images and the removal of all images in the catalog magento#11153
2 parents e70975c + 3e05139 commit aa17e5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function processDeletedImages($product, array &$images)
3636
$catalogPath = $this->mediaConfig->getBaseMediaPath();
3737
$isFile = $this->mediaDirectory->isFile($catalogPath . $image['file']);
3838
// only delete physical files if they are not used by any other products and if this file exist
39-
if (!($this->resourceModel->countImageUses($image['file']) > 1) && $isFile) {
39+
if ($isFile && !($this->resourceModel->countImageUses($image['file']) > 1)) {
4040
$filesToDelete[] = ltrim($image['file'], '/');
4141
}
4242
}

0 commit comments

Comments
 (0)