[BUGFIX] Fix display of indexed search advanced search fields 60/56960/2
authorGianluca Piccolo <gianluca.piccolo@pallino.it>
Mon, 14 May 2018 07:42:45 +0000 (09:42 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 14 May 2018 13:18:34 +0000 (15:18 +0200)
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/56960
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/indexed_search/Classes/Controller/SearchController.php

index 1b68c3a..20c07b8 100644 (file)
@@ -1495,38 +1495,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()
+        ];
     }
 
     /**