diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index a601d467e0f..8988ffce455 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -269,14 +269,13 @@ if (empty($reshook)) { if ($ret == -3) { $error++; - $tmpobject = new Product($db); - $tmpobject->fetch($object->product_id_already_linked); - $productLink = $tmpobject->getNomUrl(1, 'supplier'); + $tmpobject = new Product($db); + $tmpobject->fetch($object->product_id_already_linked); + $productLink = $tmpobject->getNomUrl(1, 'supplier'); - $texttoshow = $langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", '{s1}'); - $texttoshow = str_replace('{s1}', $productLink, $texttoshow); - setEventMessages($texttoshow, null, 'errors'); - + $texttoshow = $langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct", '{s1}'); + $texttoshow = str_replace('{s1}', $productLink, $texttoshow); + setEventMessages($texttoshow, null, 'errors'); } elseif ($ret < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors');