Fix: prendre en compte les erreurs des triggers dans la fonction, ne pas faire de retour d'erreurs a partir du trigger pour ne pas les prendre en compte.
This commit is contained in:
parent
ad92ef19c4
commit
ff37e4286a
@ -1602,6 +1602,8 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = ".$this->id;
|
||||||
@ -1658,11 +1660,19 @@ class Propal extends CommonObject
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
dol_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG);
|
dol_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG);
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -2;
|
return -2;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user