Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit 3e05139

Browse files
author
Oleksii Korshenko
committed
MAGETWO-80717: Fix the correct removal of the images and the removal of all images in the catalog #11153
- Merge Pull Request magento/magento2#11153 from raumatbel/magento2:FR#RemoveImages - Merged commits: 1. 6625945 2. 39e06b0 3. 92d8418 4. 8731d97 5. 7715950 6. eba2fbd 7. 9778bfb 8. 5039c94 9. 10ef2e7
2 parents 45d1d93 + 10ef2e7 commit 3e05139

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

Lines changed: 1 addition & 1 deletion
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)