From f5b58b6f123496718eebf412eb19e6ed4f55b520 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Thu, 19 Jul 2012 14:26:02 +0200
Subject: [PATCH] Fix: Missing fields into insert from webservice

---
 htdocs/product/class/product.class.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index ab68d73a8db..4d4a9e03e98 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -277,6 +277,7 @@ class Product extends CommonObject
 				$sql.= "datec";
 				$sql.= ", entity";
 				$sql.= ", ref";
+				$sql.= ", ref_ext";
 				$sql.= ", price_min";
 				$sql.= ", price_min_ttc";
 				$sql.= ", label";
@@ -292,7 +293,8 @@ class Product extends CommonObject
 				$sql.= ") VALUES (";
 				$sql.= $this->db->idate($now);
 				$sql.= ", ".$conf->entity;
-				$sql.= ", '".$this->ref."'";
+				$sql.= ", '".$this->db->escape($this->ref)."'";
+				$sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null");
 				$sql.= ", ".price2num($price_min_ht);
 				$sql.= ", ".price2num($price_min_ttc);
 				$sql.= ", ".($this->libelle?"'".$this->db->escape($this->libelle)."'":"null");
-- 
GitLab