From 650e9b8c2bffd7395164245d6b80a3f25ce93f9f Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Thu, 4 Apr 2024 23:22:10 +0200 Subject: [PATCH 1/2] Fix #29115 --- htdocs/product/class/api_products.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 0d01072f8e8..0a008093c28 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -368,7 +368,12 @@ class Products extends DolibarrApi $this->product->context['caller'] = sanitizeVal($request_data['caller'], 'aZ09'); continue; } - + if ($field == 'array_options' && is_array($value)) { + foreach ($value as $index => $val) { + $this->product->array_options[$index] = $val; + } + continue; + } $this->product->$field = $this->_checkValForAPI($field, $value, $this->product); } From aab69e6a1f72ea8780d1eead813982834652ce0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Apr 2024 10:35:01 +0200 Subject: [PATCH 2/2] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 0a008093c28..351fb39e1f7 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -370,7 +370,7 @@ class Products extends DolibarrApi } if ($field == 'array_options' && is_array($value)) { foreach ($value as $index => $val) { - $this->product->array_options[$index] = $val; + $this->product->array_options[$index] = $this->_checkValForAPI($field, $val, $this->product); } continue; }