From 28e4be3b0ecbe937ac8710bace428c44b4e6bb6a Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 22 Nov 2020 16:25:38 +0100 Subject: [PATCH] Fix contact API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get roles by API (without GET this data, we can't add this to POST, so data was deleted 👎 ) --- htdocs/societe/class/api_contacts.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index bc456dd7185..a32619855fd 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -78,6 +78,7 @@ class Contacts extends DolibarrApi $result = $this->contact->initAsSpecimen(); } else { $result = $this->contact->fetch($id); + $this->contact->fetchRoles(); } if (!$result) @@ -120,6 +121,7 @@ class Contacts extends DolibarrApi $result = $this->contact->initAsSpecimen(); } else { $result = $this->contact->fetch('', '', '', $email); + $this->contact->fetchRoles(); } if (!$result) @@ -241,6 +243,7 @@ class Contacts extends DolibarrApi $contact_static = new Contact($this->db); if ($contact_static->fetch($obj->rowid)) { + $contact_static->fetchRoles(); if ($includecount) { $contact_static->load_ref_elements();