From f8e8b39ff2b16e08961c5b68deefa8fb97acc295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 01:27:28 +0200 Subject: [PATCH 1/2] FIX #2758 Product::update sets product note to "null" when $prod->note is null --- ChangeLog | 1 + htdocs/product/class/product.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c4919910d9..1173dab3204 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref +Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e6695b75bc6..9dac082a1a3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -442,7 +442,7 @@ class Product extends CommonObject $this->ref = dol_string_nospecial(trim($this->ref)); $this->libelle = trim($this->libelle); $this->description = trim($this->description); - $this->note = (isset($this->note)? trim($this->note):"null"); + $this->note = (isset($this->note)? trim($this->note):null); $this->weight = price2num($this->weight); $this->weight_units = trim($this->weight_units); $this->length = price2num($this->length); @@ -493,7 +493,7 @@ class Product extends CommonObject $sql.= ", accountancy_code_sell= '" . $this->accountancy_code_sell."'"; $sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null"); $sql.= " WHERE rowid = " . $id; - +var_dump($sql);die; dol_syslog(get_class($this)."update sql=".$sql); $resql=$this->db->query($sql); if ($resql) From f6616deef3b74343a5c28adc969540366f1ed878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 01:28:40 +0200 Subject: [PATCH 2/2] Removed debugging function --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9dac082a1a3..10762d4e271 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -493,7 +493,7 @@ class Product extends CommonObject $sql.= ", accountancy_code_sell= '" . $this->accountancy_code_sell."'"; $sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null"); $sql.= " WHERE rowid = " . $id; -var_dump($sql);die; + dol_syslog(get_class($this)."update sql=".$sql); $resql=$this->db->query($sql); if ($resql)