Merge pull request #32555 from FHenry/20.0_fix_catching_error_on_Notification

fix: manage error in Notification trigger
This commit is contained in:
Laurent Destailleur 2025-01-07 16:00:52 +01:00 committed by GitHub
commit 973b6b8bdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,7 +94,11 @@ class InterfaceNotification extends DolibarrTriggers
dol_syslog("Trigger '".$this->name."' for action '".$action."' launched by ".__FILE__.". id=".$object->id);
$notify = new Notify($this->db);
$notify->send($action, $object);
$resultSend = $notify->send($action, $object);
if ($resultSend < 0) {
$this->errors = array_merge($this->errors, $notify->errors);
return $resultSend;
}
return 1;
}