Merge pull request #24212 from kubajznik/kubajznik-contacts-api-put-extrafields

NEW No overwrite of optionals during put() contact
This commit is contained in:
Laurent Destailleur 2023-03-17 21:14:38 +01:00 committed by GitHub
commit ed9311aa0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,8 +326,13 @@ class Contacts extends DolibarrApi
foreach ($request_data as $field => $value) {
if ($field == 'id') {
continue;
} elseif ($field == 'array_options' && is_array($value)) {
foreach ($value as $index => $val) {
$this->contact->array_options[$index] = $val;
}
} else {
$this->contact->$field = $value;
}
$this->contact->$field = $value;
}
if (isModEnabled('mailing') && !empty($this->contact->email) && isset($this->contact->no_email)) {