diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c192b29eb7e..42b3ee1ec9c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -668,14 +668,14 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } else { if ($object->error == 'ErrorProductAlreadyExists') { - // permet une action personnallisée quand il y a tentative d'ajouter un produit - // avec un numéro de référence existant. + // allow to hook on ErrorProductAlreadyExists in any module $reshook = $hookmanager->executeHooks('onProductAlreadyExists', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if ($object->error) { - // L'erreur de l'objet a pu être effacée par la fonction + // check again to prevent translation issue, + // as error may have been cleared in hook function setEventMessages($langs->trans($object->error), null, 'errors'); } } else {