From d6438a51ab5d580ff1f460d44967c8bce2f8b732 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Feb 2015 15:24:15 +0100 Subject: [PATCH] Add log to help track bug --- htdocs/fourn/class/fournisseur.product.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 75ac674e877..3d12352903f 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -447,12 +447,18 @@ class ProductFournisseur extends Product * * @param int $prodid Product id * @param int $qty Minimum quantity - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Not found of no product id provided, >0 if OK */ function find_min_price_product_fournisseur($prodid, $qty=0) { global $conf; + if (empty($prodid)) + { + dol_syslog("Warning function find_min_price_product_fournisseur were called with prodid empty. May be a bug.", LOG_WARNING); + return 0; + } + $this->product_fourn_price_id = ''; $this->product_fourn_id = ''; $this->fourn_ref = ''; @@ -500,7 +506,7 @@ class ProductFournisseur extends Product return 1; } else - { + { $this->error=$this->db->error(); return -1; }