From 4b8d39af9dac45b90fb0c90114f08c174cec7ff5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2014 13:05:04 +0100 Subject: [PATCH] Fix: Do not report trigger errors twice. Fix: Error when creating event was not reported. Conflicts: htdocs/comm/action/fiche.php --- ChangeLog | 2 ++ htdocs/comm/action/fiche.php | 4 ++-- htdocs/core/class/interfaces.class.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d28705d569..90b6922d60b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.1 compared to 3.5.0 ***** +Fix: Do not report trigger errors twice. +Fix: Error when creating event was not reported. Fix: Bug of import of agenda when using https link Fix: Field nature not saved correctly Fix: Substituion of extra field was ko for order diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index d0c6a213c77..ee20189f14f 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -261,8 +261,8 @@ if ($action == 'add_action') { $db->rollback(); $langs->load("errors"); - $error=$langs->trans($actioncomm->error); - setEventMessage($error,'errors'); + if (! empty($actioncomm->error)) setEventMessage($langs->trans($actioncomm->error), 'errors'); + if (count($actioncomm->errors)) setEventMessage($actioncomm->errors, 'errors'); $action = 'create'; } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index db39f7bab86..428ea65a174 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -167,8 +167,8 @@ class Interfaces // Action KO $nbtotal++; $nbko++; - if (! empty($objMod->error)) $this->errors[]=$objMod->error; if (! empty($objMod->errors)) $this->errors=array_merge($this->errors,$objMod->errors); + else if (! empty($objMod->error)) $this->errors[]=$objMod->error; } } else