Fix contact API

Get roles by API (without GET this data, we can't add this to POST, so data was deleted 👎 )
This commit is contained in:
ptibogxiv 2020-11-22 16:25:38 +01:00 committed by GitHub
parent af2eabb24d
commit 28e4be3b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();