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