Skip to content

Commit

Permalink
Merge pull request #8951 from fappels/7.0_fix_ErrorProductAlreadyExists
Browse files Browse the repository at this point in the history
Fix Wrong error for duplicate ref if barcode enabled but not set.
  • Loading branch information
eldy committed Jun 13, 2018
2 parents eabb3e9 + a86c90f commit 76ee88f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/product/class/product.class.php
Expand Up @@ -1000,7 +1000,7 @@ function update($id, $user, $notrigger=false, $action='update')
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
if (empty($conf->barcode->enabled)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
if (empty($conf->barcode->enabled) || empty($this->barcode)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
else $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductBarCodeAlreadyExists",$this->barcode);
$this->errors[]=$this->error;
$this->db->rollback();
Expand Down

0 comments on commit 76ee88f

Please sign in to comment.