From 1499998a99f856f8bb95dba1f1a9dbc3091152c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jan 2021 12:17:45 +0100 Subject: [PATCH] Debug --- .../barcode/mod_barcode_product_standard.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 8b851e0fec1..6de9ed06792 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -151,23 +151,24 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode { global $conf; $out = ''; - $this->db = $db; - $sql = "SELECT rowid, code, libelle"; + + $sql = "SELECT rowid, code, libelle as label"; $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; - $sql .= " WHERE rowid = '".$type."'"; - $sql .= " AND entity = ".$conf->entity; - $result = $this->db->query($sql); + $sql .= " WHERE rowid = '".$db->escape($type)."'"; + $sql .= " AND entity = ".((int) $conf->entity); + $result = $db->query($sql); if ($result) { - $num = $this->db->num_rows($result); + $num = $db->num_rows($result); if ($num > 0) { - $obj = $this->db->fetch_object($result); - $out .= $obj->libelle; //take the libelle corresponding to the type rowid in the database + $obj = $db->fetch_object($result); + $out .= $obj->label; //take the label corresponding to the type rowid in the database } } else { - dol_print_error($this->db); + dol_print_error($db); } + return $out; } /**