// Bug fix when deleting a file associated to a virtual product
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10209 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
1f1ca31cda
commit
284c892d4d
1 file changed
+6
-2
@@ -152,14 +152,18 @@ class ProductDownloadCore extends ObjectModel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the file
|
* Delete the file
|
||||||
|
* @param int $id_product_download : if we need to delete a specific product attribute file
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function deleteFile()
|
public function deleteFile($id_product_download = NULL)
|
||||||
{
|
{
|
||||||
if (!$this->checkFile())
|
if (!$this->checkFile())
|
||||||
return false;
|
return false;
|
||||||
return unlink(_PS_DOWNLOAD_DIR_.$this->filename);
|
|
||||||
|
return unlink(_PS_DOWNLOAD_DIR_.$this->filename) && Db::getInstance()->Execute('DELETE
|
||||||
|
FROM `'._DB_PREFIX_.'product_download`
|
||||||
|
WHERE `id_product_download` = '.(int)$id_product_download);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user