[-] BO : fixed bug #PSCFI-1429 - Deleting products does not remove image files

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@5913 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean committed 2011-04-15 10:10:23 +00:00
1 parent cfdc0ab1d9
commit 8c520c66a3
2 files changed
+8 -2

No files matched your search

+7 -1
View File
@@ -350,7 +350,13 @@ class AdminProducts extends AdminTab
$id_category = Tools::getValue('id_category'); $id_category = Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.$id_category; $category_url = empty($id_category) ? '' : '&id_category='.$id_category;
$this->deleteImage($object->id); if ($this->table == 'product')
{
$product = new Product($object->id);
$product->deleteImages();
}else
$this->deleteImage($object->id);
if ($this->deleted) if ($this->deleted)
{ {
$object->deleted = 1; $object->deleted = 1;
+1 -1
View File
@@ -472,7 +472,7 @@ abstract class AdminTabCore
{ {
$dir = null; $dir = null;
/* Deleting object images and thumbnails (cache) */ /* Deleting object images and thumbnails (cache) */
if (key_exists('dir', $this->fieldImageSettings) AND $this->fieldImageSettings['dir'].'/') if (key_exists('dir', $this->fieldImageSettings))
{ {
$dir = $this->fieldImageSettings['dir'].'/'; $dir = $this->fieldImageSettings['dir'].'/';
if (file_exists(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType)) if (file_exists(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType))