From bc56e8f1e7cee5bb3055cfd87f7f8f499cdf48cf Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 1 Apr 2024 19:11:16 +0200 Subject: [PATCH] double fix: do not remove array_options from json + allowing single option_ update without nullifying the other options_ --- htdocs/adherents/class/api_members.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 941a685d326..07f09c7dd30 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -476,7 +476,6 @@ class Members extends DolibarrApi } if ($object instanceof AdherentType) { - unset($object->array_options); unset($object->linkedObjectsIds); unset($object->context); unset($object->canvas); @@ -795,7 +794,12 @@ class Members extends DolibarrApi $membertype->context['caller'] = $request_data['caller']; continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $membertype->array_options[$index] = $val; + } + continue; + } // Process the status separately because it must be updated using // the validate(), resiliate() and exclude() methods of the class AdherentType. $membertype->$field = $value;