[BUGFIX] Make advanced search work with indexed_search extbase plugin 13/36713/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Fri, 6 Feb 2015 11:16:55 +0000 (12:16 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 6 Feb 2015 18:26:23 +0000 (19:26 +0100)
Resolves: #64904
Releases: master
Change-Id: Idd3ea31071fa37bca3e9e2aa807ab3afea561b76
Reviewed-on: http://review.typo3.org/36713
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Göran Bodenschatz <coding@46halbe.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Resources/Private/Partials/Form.html

index 91c3cc5..3272152 100644 (file)
@@ -778,7 +778,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
         * @dontvalidate $search
         */
        public function formAction($search = array()) {
-               $this->initialize($search);
+               $searchData = $this->initialize($search);
                // Adding search field value
                $this->view->assign('sword', $this->sword);
                // Additonal keyword => "Add to current search words"
@@ -821,6 +821,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                        $this->view->assign('allNumberOfResults', $allNumberOfResults);
                        $allGroups = $this->getAllAvailableGroupOptions();
                        $this->view->assign('allGroups', $allGroups);
+                       $this->view->assign('searchParams', $searchData);
                }
        }
 
@@ -886,6 +887,8 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                        $additionalMedia = trim($this->settings['mediaList']);
                        if ($additionalMedia !== '') {
                                $additionalMedia = GeneralUtility::trimExplode(',', $additionalMedia, TRUE);
+                       } else {
+                               $additionalMedia = array();
                        }
                        foreach ($this->externalParsers as $extension => $obj) {
                                // Skip unwanted extensions
index 74a6289..479050a 100644 (file)
@@ -13,8 +13,8 @@
                <f:form.hidden name="search[languageUid]" value="{searchParams.languageUid}" />
                <f:form.hidden name="search[desc]" value="{searchParams.desc}" />
                <f:form.hidden name="search[numberOfResults]" value="{searchParams.numberOfResults}" />
+               <f:form.hidden name="search[extendedSearch]" value="{searchParams.extendedSearch}" />
        </div>
-
        <fieldset>
                <legend><f:translate key="form.legend" /></legend>
 
@@ -27,7 +27,6 @@
                        <f:form.hidden name="search[sword_prev]" value="{previousSearchWord}" />
                        <f:form.checkbox name="search[sword_prev_include]" id="tx_indexedsearch_sword_prev_include" value="1" checked="{searchParams.sword_prev}" /> <label for="tx_indexedsearch_sword_prev_include"><f:translate key="form.addToSearch" />.</label>
                </f:if>
-
                <f:if condition="{searchParams.extendedSearch}">
                        <f:if condition="{showTypeSearch}">
                                <div class="tx-indexedsearch-search-for">
                <p>
                <f:if condition="{searchParams.extendedSearch}">
                        <f:then>
-                               <f:link.action action="form" arguments="{extendedSearch: 0}"><f:translate key="form.linkToRegularSearch" /></f:link.action>
+                               <f:link.action action="form" arguments="{search: {extendedSearch: 0}}"><f:translate key="form.linkToRegularSearch" /></f:link.action>
                        </f:then>
                        <f:else>
-                               <f:link.action action="form" arguments="{extendedSearch: 1}"><f:translate key="form.linkToAdvancedSearch" /></f:link.action>
+                               <f:link.action action="form" arguments="{search: {extendedSearch: 1}}"><f:translate key="form.linkToAdvancedSearch" /></f:link.action>
                        </f:else>
                </f:if>
                </p>