From 791a509c6c0c7dd9e1aa6d9b9a7be5d9fac01401 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jan 2021 13:26:50 +0100 Subject: [PATCH] Fix warning --- htdocs/webservices/server_thirdparty.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index a4f7e21221d..6d44fe41ff6 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -370,7 +370,9 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') { foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) { - $thirdparty_result_fields = array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key])); + if (isset($thirdparty->array_options['options_'.$key])) { + $thirdparty_result_fields = array_merge($thirdparty_result_fields, array('options_'.$key => $thirdparty->array_options['options_'.$key])); + } } } @@ -623,7 +625,9 @@ function updateThirdParty($authentication, $thirdparty) foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) { $key = 'options_'.$key; - $object->array_options[$key] = $thirdparty[$key]; + if (isset($thirdparty[$key])) { + $object->array_options[$key] = $thirdparty[$key]; + } } } @@ -728,7 +732,9 @@ function getListOfThirdParties($authentication, $filterthirdparty) { foreach ($extrafields->attributes[$elementtype]['label'] as $key => $label) { - $extrafieldsOptions['options_'.$key] = $obj->{$key}; + if (isset($obj->{$key})) { + $extrafieldsOptions['options_'.$key] = $obj->{$key}; + } } }