From d4d3b9900d0d77e0f45b528bbb089f874baf4b1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sun, 24 Mar 2013 14:11:10 +0100 Subject: [PATCH] Fix: creation of user --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 37ff6735df5..bd7095f4d03 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1133,8 +1133,8 @@ class User extends CommonObject $sql.= ", address = '".$this->db->escape($this->address)."'"; $sql.= ", zip = '".$this->db->escape($this->zip)."'"; $sql.= ", town = '".$this->db->escape($this->town)."'"; - $sql.= ", fk_state = '".$this->db->escape($this->state_id)."'"; - $sql.= ", fk_country = '".$this->db->escape($this->country_id)."'"; + $sql.= ", fk_state = ".($this->state_id > 0?"'".$this->db->escape($this->state_id)."'":"null"); + $sql.= ", fk_country = ".($this->country_id > 0?"'".$this->db->escape($this->country_id)."'":"null"); $sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; -- GitLab