From 50a9bd368c44281ca207820e72d7f64497eaf1f7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 14 Oct 2020 18:15:48 +0200 Subject: [PATCH] review --- htdocs/install/mysql/data/llx_c_product_nature.sql | 1 - htdocs/product/class/product.class.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_product_nature.sql b/htdocs/install/mysql/data/llx_c_product_nature.sql index 7594e8e3f69..8351ff2ab79 100644 --- a/htdocs/install/mysql/data/llx_c_product_nature.sql +++ b/htdocs/install/mysql/data/llx_c_product_nature.sql @@ -23,7 +23,6 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_product_nature (code, label, active) VALUES (-1, '', 1); INSERT INTO llx_c_product_nature (code, label, active) VALUES (0, 'RowMaterial', 1); INSERT INTO llx_c_product_nature (code, label, active) VALUES (1, 'Finished', 1); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index edaa5e6857b..1b567d31edb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4563,7 +4563,7 @@ class Product extends CommonObject $langs->load('products'); if (isset($this->finished) && $this->finished>=0) { - $sql = 'SELECT label, code FROM '.MAIN_DB_PREFIX.'c_product_nature where code='.$this->finished.' AND active=1'; + $sql = 'SELECT label, code FROM '.MAIN_DB_PREFIX.'c_product_nature where code='.((int) $this->finished).' AND active=1'; $resql = $this->db->query($sql); if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql);