diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 26fc4c57063..4f0081551ca 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -128,7 +128,7 @@ foreach($extrafields->attribute_label as $key=>$label) $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$actioncomm_fields=array_merge($actioncomm_fields,$extrafield_array); +if (is_array($extrafield_array)) $actioncomm_fields=array_merge($actioncomm_fields,$extrafield_array); // Define other specific objects $server->wsdl->addComplexType( diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index f5da8324521..fe4fcc3378f 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -133,7 +133,7 @@ foreach($extrafields->attribute_label as $key=>$label) $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$contact_fields=array_merge($contact_fields,$extrafield_array); +if (is_array($extrafield_array)) $contact_fields=array_merge($contact_fields,$extrafield_array); // Define other specific objects $server->wsdl->addComplexType( diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index cad29aa3252..eb42dd74ce4 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -128,7 +128,7 @@ foreach($extrafields->attribute_label as $key=>$label) else {$type='xsd:string';} $extrafield_line_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$line_fields=array_merge($line_fields,$extrafield_line_array); +if (is_array($extrafield_line_array)) $line_fields=array_merge($line_fields,$extrafield_line_array); // Define other specific objects $server->wsdl->addComplexType( @@ -216,7 +216,8 @@ $order_fields = array( // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('commande',true); -if (count($extrafields)>0) { +$extrafield_array=null; +if (is_array($extrafields) && count($extrafields)>0) { $extrafield_array = array(); } foreach($extrafields->attribute_label as $key=>$label) @@ -227,7 +228,7 @@ foreach($extrafields->attribute_label as $key=>$label) else {$type='xsd:string';} $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$order_fields=array_merge($order_fields,$extrafield_array); +if (is_array($extrafield_array)) $order_fields=array_merge($order_fields,$extrafield_array); $server->wsdl->addComplexType( 'order', diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 0df33d5955f..00dcd2fe4fc 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -147,7 +147,7 @@ foreach($extrafields->attribute_label as $key=>$label) $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$productorservice_fields=array_merge($productorservice_fields,$extrafield_array); +if (is_array($extrafield_array)) $productorservice_fields=array_merge($productorservice_fields,$extrafield_array); // Define other specific objects $server->wsdl->addComplexType( diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index bd2659306bc..9e10b0212ec 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -175,7 +175,7 @@ foreach($extrafields->attribute_label as $key=>$label) else {$type='xsd:string';} $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$project_fields=array_merge($project_fields,$extrafield_array); +if (is_array($extrafield_array)) $project_fields=array_merge($project_fields,$extrafield_array); $server->wsdl->addComplexType( 'project', diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index a367020e6d4..8e358e21924 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -138,7 +138,7 @@ foreach($extrafields->attribute_label as $key=>$label) $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); } -$thirdparty_fields=array_merge($thirdparty_fields,$extrafield_array); +if (is_array($extrafield_array)) $thirdparty_fields=array_merge($thirdparty_fields,$extrafield_array); // Define other specific objects $server->wsdl->addComplexType( diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 3718378f8ce..60bf95bd20c 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -200,7 +200,7 @@ foreach($extrafields->attribute_label as $key=>$label) $extrafield_array['contact_options_'.$key]=array('name'=>'contact_options_'.$key,'type'=>$type); } -$thirdpartywithuser_fields=array_merge($thirdpartywithuser_fields,$extrafield_array); +if (is_array($extrafield_array)) $thirdpartywithuser_fields=array_merge($thirdpartywithuser_fields,$extrafield_array); $server->wsdl->addComplexType(