From 3e3c541e4c93b03fdfe5f5730214e59890de4fe2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2014 12:54:04 +0100 Subject: [PATCH 1/2] Fix: Do not report trigger errors twice. Fix: Error when creating event was not reported. --- htdocs/comm/action/fiche.php | 6 +++--- htdocs/core/class/interfaces.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 5b8cb84fea9..9f5005570bc 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -226,7 +226,7 @@ if ($action == 'add_action') // On cree l'action $idaction=$object->add($user); - + if ($idaction > 0) { if (! $object->error) @@ -261,8 +261,8 @@ if ($action == 'add_action') { $db->rollback(); $langs->load("errors"); - $error=$langs->trans($object->error); - setEventMessage($error,'errors'); + if (! empty($object->error)) setEventMessage($langs->trans($object->error), 'errors'); + if (count($object->errors)) setEventMessage($object->errors, 'errors'); $action = 'create'; } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index deaa2eaac59..1b49760b5bd 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 From 4b5748fd12efa37d3e18b85f35579268e1f67131 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2014 12:58:03 +0100 Subject: [PATCH 2/2] Fix: Can not set delay to zero. --- htdocs/admin/delais.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 7aeb6eb9f78..e16240bf251 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -107,7 +107,7 @@ if ($action == 'update') { foreach($delays as $delay) { - if (GETPOST($delay['code'])) + if (GETPOST($delay['code']) != '') { dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); }