Skip to content

Commit 9ae7533

Browse files
authored
Update FbimagecleanerController.php
bugfix
1 parent 994b50a commit 9ae7533

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public function syncproductAction()
7373

7474
$attributes = $db->fetchCol("SELECT attribute_id FROM {$resource->getTableName('eav_attribute')} WHERE entity_type_id={$entity_type_id} AND frontend_input='media_image'");
7575
$attributes = implode(",", $attributes);
76-
$db_images = $db->fetchCol("SELECT value FROM {$resource->getTableName('catalog_category_entity_varchar')} WHERE value IS NOT NULL AND LENGTH(value)>0 AND entity_type_id={$entity_type_id} AND attribute_id IN ($attributes)");
76+
$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'");
77+
if ($db_images) $db_images = substr_replace($db_images, '', 0, 1);
7778

7879
$media_gallery = $db->fetchCol("SELECT value FROM {$resource->getTableName('catalog_product_entity_media_gallery')} WHERE value IS NOT NULL AND LENGTH(value)>0");
7980
if ($media_gallery) $media_gallery = substr_replace($media_gallery, '', 0, 1);
@@ -136,4 +137,4 @@ public function massDeleteAction()
136137

137138
$this->_redirect('*/*');
138139
}
139-
}
140+
}

0 commit comments

Comments
 (0)