From 9f2ac7cae308734c38e951b5d5a49e1d8ae84788 Mon Sep 17 00:00:00 2001 From: oscim Date: Thu, 3 Oct 2019 09:47:06 +0200 Subject: [PATCH 1/2] Fix error in triggers process If methode create_from_contact is called; In process this method containt call create methode, but trigger by action USER_CREATE is called twice. the call to the create method should not trigger triggers same for the create_from_members method --- 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 04ec5bf0698..30eb6f1cd27 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1298,7 +1298,7 @@ class User extends CommonObject $this->db->begin(); // Cree et positionne $this->id - $result=$this->create($user); + $result=$this->create($user, 1); if ($result > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; @@ -1371,7 +1371,7 @@ class User extends CommonObject $this->db->begin(); // Create and set $this->id - $result=$this->create($user); + $result=$this->create($user, 1); if ($result > 0) { $newpass=$this->setPassword($user, $this->pass); From d368bc1b6a6039dd4766426ef4f2eaee3f7ed443 Mon Sep 17 00:00:00 2001 From: oscim Date: Thu, 3 Oct 2019 15:58:40 +0200 Subject: [PATCH 2/2] Update user.class.php actually the create_from_member method does not require this change --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 30eb6f1cd27..57ded5e6c1c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1371,7 +1371,7 @@ class User extends CommonObject $this->db->begin(); // Create and set $this->id - $result=$this->create($user, 1); + $result=$this->create($user); if ($result > 0) { $newpass=$this->setPassword($user, $this->pass);