Skip to content

Commit b2a7b46

Browse files
committed
https://github.com/fballiano/openmage-image-cleaner/issues/19
1 parent 9ca0045 commit b2a7b46

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Features
88
- Check before delete: you can review (and download) the identified images before removing them.
99
- Possibility to **blacklist folders and/or files** (with wildcard support) not to ever identify them as orphans.
1010
- Possibility to **flush media/import, media/tmp, var/export, var/importexport**.
11-
- Compatible with **Magento 1.9 and OpenMage 20.0 on PHP 7.2, 7.3, 7.4**.
11+
- Compatible with **Magento 1.9, OpenMage 19 and OpenMage 20 on PHP 7.2, 7.3, 7.4, 8.0**.
1212

1313
How to use it
1414
-------------

app/code/community/Fballiano/ImageCleaner/controllers/Adminhtml/FbimagecleanerController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ public function syncproductAction()
9191
$db_images = $db->fetchCol("SELECT value FROM {$resource->getTableName('catalog_product_entity_varchar')} WHERE value IS NOT NULL AND LENGTH(value)>0 AND entity_type_id={$entity_type_id} AND attribute_id IN ($attributes) AND value <> 'no_selection'");
9292
if ($db_images) $db_images = substr_replace($db_images, '', 0, 1);
9393

94+
$placeholders = $db->fetchCol("SELECT DISTINCT value FROM {$resource->getTableName('core_config_data')} WHERE path LIKE 'catalog/placeholder/%_placeholder'");
95+
if ($placeholders) {
96+
foreach ($placeholders as $placeholder) {
97+
$db_images[] = "placeholder/{$placeholder}";
98+
}
99+
}
100+
94101
$media_gallery = $db->fetchCol("SELECT value FROM {$resource->getTableName('catalog_product_entity_media_gallery')} WHERE value IS NOT NULL AND LENGTH(value)>0");
95102
if ($media_gallery) $media_gallery = substr_replace($media_gallery, '', 0, 1);
96103

0 commit comments

Comments
 (0)