From 38d0303003d4f37083ac69d992df6073e623013e Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 22 Feb 2017 12:26:09 +0100 Subject: [PATCH] Fix selects see BT#10849 --- load_search.php | 7 ++++--- search.php | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/load_search.php b/load_search.php index ab8210c3e4..3c87ffdd24 100644 --- a/load_search.php +++ b/load_search.php @@ -458,10 +458,11 @@ $domaine2 = $form->getElementByName('extra_domaine[1]'); $domaine3 = $form->getElementByName('extra_domaine[2]'); $userForm->setDefaults($defaults); $domainList = array_merge( - $domaine1->getValue(), - $domaine3->getValue(), - $domaine2->getValue() + is_object($domaine1) ? $domaine1->getValue() : [], + is_object($domaine3) ? $domaine3->getValue() : [], + is_object($domaine2) ? $domaine2->getValue() : [] ); + $themeList = []; $extraField = new ExtraField('session'); $resultOptions = $extraField->searchOptionsFromTags('extra_domaine', 'extra_'.$theme, $domainList); diff --git a/search.php b/search.php index cbc678df37..1354979876 100644 --- a/search.php +++ b/search.php @@ -177,6 +177,7 @@ if (!empty($items)) { /** @var ExtraFieldSavedSearch $item */ foreach ($items as $item) { $variable = 'extra_'.$item->getField()->getVariable(); + if ($item->getField()->getFieldType() == Extrafield::FIELD_TYPE_TAG) { $tagsData[$variable] = $item->getValue(); } @@ -473,7 +474,6 @@ $fieldsToShow = [ 'domaine', $theme ]; - $extra = $extraFieldSession->addElements( $userForm, api_get_user_id(), @@ -617,9 +617,9 @@ $domaine2 = $userForm->getElementByName('extra_domaine[1]'); $domaine3 = $userForm->getElementByName('extra_domaine[2]'); $domainList = array_merge( - is_array($domaine1) ? $domaine1->getValue() : [], - is_array($domaine3) ? $domaine3->getValue() : [], - is_array($domaine2) ? $domaine2->getValue() : [] + is_object($domaine1) ? $domaine1->getValue() : [], + is_object($domaine3) ? $domaine3->getValue() : [], + is_object($domaine2) ? $domaine2->getValue() : [] ); $themeList = [];