You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/code/community/Fballiano/ImageCleaner/controllers/Adminhtml/FbimagecleanerController.php
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ public function syncproductAction()
79
79
$attributes = $db->fetchCol("SELECT attribute_id FROM {$resource->getTableName('eav_attribute')} WHERE entity_type_id={$entity_type_id} AND frontend_input='media_image'");
80
80
$attributes = implode(",", $attributes);
81
81
$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'");
82
-
if ($db_images) $db_images = substr_replace($db_images, '', 0, 1);
82
+
if ($db_images) $db_images = array_map([$this, 'removeLeadingSlash'], $db_images);
83
83
84
84
$placeholders = $db->fetchCol("SELECT DISTINCT value FROM {$resource->getTableName('core_config_data')} WHERE path LIKE 'catalog/placeholder/%_placeholder'");
85
85
if ($placeholders) {
@@ -89,7 +89,7 @@ public function syncproductAction()
89
89
}
90
90
91
91
$media_gallery = $db->fetchCol("SELECT value FROM {$resource->getTableName('catalog_product_entity_media_gallery')} WHERE value IS NOT NULL AND LENGTH(value)>0");
92
-
if ($media_gallery) $media_gallery = substr_replace($media_gallery, '', 0, 1);
92
+
if ($media_gallery) $media_gallery = array_map([$this, 'removeLeadingSlash'], $media_gallery);
0 commit comments