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:
Regis Houssin 2010-05-28 08:30:39 +00:00
parent ad92ef19c4
commit ff37e4286a

View File

@ -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,9 +1660,17 @@ class Propal extends CommonObject
// End call triggers // End call triggers
} }
dol_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG); if (!$error)
$this->db->commit(); {
return 1; dol_syslog("Suppression de la proposition $this->id par $user->id", LOG_DEBUG);
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
return 0;
}
} }
else else
{ {