Fix: Gestion erreur sur cration produit en double

This commit is contained in:
Laurent Destailleur 2006-06-08 19:53:55 +00:00
parent 5874fafb34
commit b0a5267fab

View File

@ -114,6 +114,7 @@ class Product
*/
function create($user)
{
global $langs;
$this->ref = trim(sanitize_string($this->ref));
@ -175,13 +176,15 @@ class Product
}
else
{
$this->error=$this->db->error()." - ".$sql;
$this->error=$this->db->error()." - sql=".$sql;
$this->db->rollback();
return -3;
}
}
else
{
// Produit existe deja
$this->error=$langs->trans("ErrorProductAlreadyExists");
$this->db->rollback();
return -2;
}