From daa18360d7263a7594198ab2a94172a9992d6492 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jan 2025 13:16:32 +0100 Subject: [PATCH 1/3] fix: manage error in Notification triggers --- .../interface_50_modNotification_Notification.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index b9a009f7c0a..3ef8a86ab25 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -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; } From fc54c837fa899eaa1fed016373972435eacad0f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2025 15:59:07 +0100 Subject: [PATCH 2/3] Update interface_50_modNotification_Notification.class.php --- .../interface_50_modNotification_Notification.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 3ef8a86ab25..18e1dd246ca 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -95,7 +95,7 @@ class InterfaceNotification extends DolibarrTriggers $notify = new Notify($this->db); $resultSend = $notify->send($action, $object); - if ($resultSend<0) { + if ($resultSend < 0) { $this->errors=array_merge($this->errors, $notify->errors); return $resultSend; } From 1d8f9fd24b33e36745e9a6fc018df2775636827b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2025 16:00:31 +0100 Subject: [PATCH 3/3] Update interface_50_modNotification_Notification.class.php --- .../interface_50_modNotification_Notification.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 18e1dd246ca..8fceee8e47a 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -96,7 +96,7 @@ class InterfaceNotification extends DolibarrTriggers $notify = new Notify($this->db); $resultSend = $notify->send($action, $object); if ($resultSend < 0) { - $this->errors=array_merge($this->errors, $notify->errors); + $this->errors = array_merge($this->errors, $notify->errors); return $resultSend; }