Fix: Gestion erreur sur création 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) function create($user)
{ {
global $langs;
$this->ref = trim(sanitize_string($this->ref)); $this->ref = trim(sanitize_string($this->ref));
@ -175,13 +176,15 @@ class Product
} }
else else
{ {
$this->error=$this->db->error()." - ".$sql; $this->error=$this->db->error()." - sql=".$sql;
$this->db->rollback(); $this->db->rollback();
return -3; return -3;
} }
} }
else else
{ {
// Produit existe deja
$this->error=$langs->trans("ErrorProductAlreadyExists");
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }