FIX Must delete extrafields before main table on product deletion.
This commit is contained in:
parent
33f8c53cca
commit
8658f903fa
@ -1241,6 +1241,16 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Remove extrafields
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete product
|
||||
if (!$error) {
|
||||
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
||||
@ -1268,16 +1278,6 @@ class Product extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Remove extrafields
|
||||
if (!$error)
|
||||
{
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user