Skip to content

Commit

Permalink
Fix Wrong error for duplicate ref if barcode enabled but not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
fappels committed Jun 12, 2018
1 parent 31eeaf9 commit a86c90f
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 a86c90f

Please sign in to comment.