From d55f5a47a00fc13c1ea991b32b63621c871ec7d4 Mon Sep 17 00:00:00 2001 From: Gianluca Piccolo <gianluca.piccolo@pallino.it> Date: Mon, 14 May 2018 09:42:45 +0200 Subject: [PATCH] [BUGFIX] Fix display of indexed search advanced search fields There were some advanced search fields in indexed search that disappeared after the last update. In SearchController, method processExtendedSearchParameters, there were some non-existing variables that were used in some conditions. With this patch, those variables are initialized before the conditions and all the advanced search fields in indexed search are shown again. Releases: master, 8.7 Resolves: #84995 Change-Id: I69aef4c7a3d869d519e84866929f4724c61eabd7 Reviewed-on: https://review.typo3.org/56958 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Susanne Moog <susanne.moog@typo3.org> Tested-by: Susanne Moog <susanne.moog@typo3.org> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> --- .../Classes/Controller/SearchController.php | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/typo3/sysext/indexed_search/Classes/Controller/SearchController.php b/typo3/sysext/indexed_search/Classes/Controller/SearchController.php index 24646727a85b..0d3ee887cd21 100644 --- a/typo3/sysext/indexed_search/Classes/Controller/SearchController.php +++ b/typo3/sysext/indexed_search/Classes/Controller/SearchController.php @@ -1514,38 +1514,34 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle /** * Process variables related to indexed_search extendedSearch needed by frontend view. * Populate select boxes and setting some flags. - * The returned data should be passed into the view by assignMultiple() + * The returned data can be passed directly into the view by assignMultiple() * * @return array Variables to pass into the view so they can be used in fluid template */ protected function processExtendedSearchParameters() { - // "Search for" - $extendedSearchParameters['allSearchTypes'] = $this->getAllAvailableSearchTypeOptions(); - $extendedSearchParameters['allDefaultOperands'] = $this->getAllAvailableOperandsOptions(); - $extendedSearchParameters['showTypeSearch'] = !empty($allSearchTypes) || !empty($allDefaultOperands); - - // "Search in" - $extendedSearchParameters['allMediaTypes'] = $this->getAllAvailableMediaTypesOptions(); - $extendedSearchParameters['allLanguageUids'] = $this->getAllAvailableLanguageOptions(); - $extendedSearchParameters['showMediaAndLanguageSearch'] = !empty($allMediaTypes) || !empty($allLanguageUids); - - // Sections - $extendedSearchParameters['allSections'] = $this->getAllAvailableSectionsOptions(); - - // Free Indexing Configurations - $extendedSearchParameters['allIndexConfigurations'] = $this->getAllAvailableIndexConfigurationsOptions(); - - // Sorting - $extendedSearchParameters['allSortOrders'] = $this->getAllAvailableSortOrderOptions(); - $extendedSearchParameters['allSortDescendings'] = $this->getAllAvailableSortDescendingOptions(); - $extendedSearchParameters['showSortOrders'] = !empty($allSortOrders) || !empty($allSortDescendings); - - // Limits - $extendedSearchParameters['allNumberOfResults'] = $this->getAllAvailableNumberOfResultsOptions(); - $extendedSearchParameters['allGroups'] = $this->getAllAvailableGroupOptions(); - - return $extendedSearchParameters; + $allSearchTypes = $this->getAllAvailableSearchTypeOptions(); + $allDefaultOperands = $this->getAllAvailableOperandsOptions(); + $allMediaTypes = $this->getAllAvailableMediaTypesOptions(); + $allLanguageUids = $this->getAllAvailableLanguageOptions(); + $allSortOrders = $this->getAllAvailableSortOrderOptions(); + $allSortDescendings = $this->getAllAvailableSortDescendingOptions(); + + return [ + 'allSearchTypes' => $allSearchTypes, + 'allDefaultOperands' => $allDefaultOperands, + 'showTypeSearch' => !empty($allSearchTypes) || !empty($allDefaultOperands), + 'allMediaTypes' => $allMediaTypes, + 'allLanguageUids' => $allLanguageUids, + 'showMediaAndLanguageSearch' => !empty($allMediaTypes) || !empty($allLanguageUids), + 'allSections' => $this->getAllAvailableSectionsOptions(), + 'allIndexConfigurations' => $this->getAllAvailableIndexConfigurationsOptions(), + 'allSortOrders' => $allSortOrders, + 'allSortDescendings' => $allSortDescendings, + 'showSortOrders' => !empty($allSortOrders) || !empty($allSortDescendings), + 'allNumberOfResults' => $this->getAllAvailableNumberOfResultsOptions(), + 'allGroups' => $this->getAllAvailableGroupOptions() + ]; } /** -- GitLab