// Fixed #PSTEST-643

This commit is contained in:
bMancone
2012-02-06 10:49:55 +00:00
parent bf70b5d28d
commit 1596fdff2f
2 changed files with 17 additions and 3 deletions
+12 -1
View File
@@ -658,7 +658,8 @@ class ProductCore extends ObjectModel
!$this->deleteSceneProducts() || !$this->deleteSceneProducts() ||
!$this->deleteSearchIndexes() || !$this->deleteSearchIndexes() ||
!$this->deleteAccessories() || !$this->deleteAccessories() ||
!$this->deleteFromAccessories()) !$this->deleteFromAccessories() ||
!$this->deleteFromSupplier())
return false; return false;
if ($id = ProductDownload::getIdFromIdProduct($this->id)) if ($id = ProductDownload::getIdFromIdProduct($this->id))
@@ -680,6 +681,16 @@ class ProductCore extends ObjectModel
return $return; return $return;
} }
public function deleteFromSupplier()
{
$return = Db::getInstance()->execute(
'DELETE FROM `'._DB_PREFIX_.'product_supplier`
WHERE `id_product` = '.(int)$this->id
);
return $return;
}
/** /**
* addToCategories add this product to the category/ies if not exists. * addToCategories add this product to the category/ies if not exists.
* *
@@ -392,8 +392,11 @@ class AdminSuppliersControllerCore extends AdminController
else else
{ {
$address = new Address($obj->id_address); $address = new Address($obj->id_address);
$address->deleted = 1; if (Validate::isLoadedObject($address))
$address->save(); {
$address->deleted = 1;
$address->save();
}
return parent::postProcess(); return parent::postProcess();
} }
} }