diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 5e11c5cb030..3160c8e289a 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -88,7 +88,7 @@ if ($action == 'addcontact' && $user->rights->commande->creer) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { - dol_print_error($db); + setEventMessages($object->error, $object->errors, 'errors'); } } /* diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index d673af33f16..f52aa20d494 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -78,7 +78,7 @@ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $ if ($object->fetch($id)) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } else { - dol_print_error($db); + setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'deletecontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { // Deleting a contact @@ -89,7 +89,7 @@ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $ header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { - dol_print_error($db); + setEventMessages($object->error, $object->errors, 'errors'); } }