Update api_contacts.class.php
This commit is contained in:
parent
73321f0812
commit
a4fa76eef4
@ -296,7 +296,7 @@ class Contacts extends DolibarrApi
|
|||||||
if ($this->contact->create(DolibarrApiAccess::$user) < 0) {
|
if ($this->contact->create(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(500, "Error creating contact", array_merge(array($this->contact->error), $this->contact->errors));
|
throw new RestException(500, "Error creating contact", array_merge(array($this->contact->error), $this->contact->errors));
|
||||||
}
|
}
|
||||||
if (isModEnabled('mailing') && !empty($this->contact->email)) {
|
if (isModEnabled('mailing') && !empty($this->contact->email) && isset($this->contact->no_email)) {
|
||||||
$this->contact->setNoEmail($this->contact->no_email);
|
$this->contact->setNoEmail($this->contact->no_email);
|
||||||
}
|
}
|
||||||
return $this->contact->id;
|
return $this->contact->id;
|
||||||
@ -331,7 +331,7 @@ class Contacts extends DolibarrApi
|
|||||||
$this->contact->$field = $value;
|
$this->contact->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isModEnabled('mailing') && !empty($this->contact->email)) {
|
if (isModEnabled('mailing') && !empty($this->contact->email) && isset($this->contact->no_email)) {
|
||||||
$this->contact->setNoEmail($this->contact->no_email);
|
$this->contact->setNoEmail($this->contact->no_email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user