diff --git a/ChangeLog b/ChangeLog index 5ec86761300..de2f3618cc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -100,6 +100,7 @@ For users: - Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action - Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message +- Fix: [ bug #1533 ] Links triggers do not show trigger error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown - Fix: datepicker first day of week can be monday by setting into display setup diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index dce575a1d47..0cdc6a8c4a8 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -187,7 +187,7 @@ class Link extends CommonObject { // Call trigger $result=$this->call_trigger('LINK_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -197,6 +197,7 @@ class Link extends CommonObject $this->db->commit(); return 1; } else { + setEventMessages('', $this->errors, 'errors'); $this->db->rollback(); return -1; } diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index a4d97e7defb..36b6ce75fe1 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -72,11 +72,16 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $link->id = $linkid; $link->fetch(); $res = $link->delete($user); + $langs->load('link'); - if ($res) { + if ($res > 0) { setEventMessage($langs->trans("LinkRemoved", $link->label)); } else { - setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); + if (count($link->errors)) { + setEventMessages('', $link->errors, 'errors'); + } else { + setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); + } } } header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':''));