[FEATURE] no_cache for forwardSearchWordsInResultLink configurable 90/20190/5
authorRalf Hettinger <ng@ralfhettinger.de>
Fri, 26 Apr 2013 15:43:34 +0000 (17:43 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 8 Oct 2015 13:36:36 +0000 (15:36 +0200)
Adding the TS property
plugin.tx_indexedsearch.forwardSearchWordsInResultLink.no_cache=boolean
which allows disabling the no_cache=1 parameter for result page links
when plugin.tx_indexedsearch.forwardSearchWordsInResultLink is enabled.
Default is 1 so that there isn't change of behaviour in existing setups.

Resolves: #47613
Releases: master
Change-Id: I465acfd41db31b835f1387a168610137b6c298c9
Reviewed-on: http://review.typo3.org/20190
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Feature-47613-IndexedSearchMakeNo_cacheParameterForForwardSearchWordsInResultLinkConfigurable.rst [new file with mode: 0644]
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Configuration/TypoScript/setup.txt
typo3/sysext/indexed_search/ext_typoscript_setup.txt

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-47613-IndexedSearchMakeNo_cacheParameterForForwardSearchWordsInResultLinkConfigurable.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-47613-IndexedSearchMakeNo_cacheParameterForForwardSearchWordsInResultLinkConfigurable.rst
new file mode 100644 (file)
index 0000000..6c741fb
--- /dev/null
@@ -0,0 +1,23 @@
+=========================================================================================================
+Feature: #47613 - Indexed Search: make no_cache parameter for forwardSearchWordsInResultLink configurable
+=========================================================================================================
+
+Description
+===========
+
+New TypoScript configuration option ``forwardSearchWordsInResultLink.no_cache`` has been added.
+It controls whether ``no_cache`` parameter should be added to page links together with search words.
+
+Use following configuration for Indexed Search Extbase plugin:
+.. code-block:: ts
+       plugin.tx_indexedsearch.settings.forwardSearchWordsInResultLink.no_cache = 1
+
+For plugin based on AbstractPlugin use:
+.. code-block:: ts
+       plugin.tx_indexedsearch.forwardSearchWordsInResultLink.no_cache = 1
+
+
+Impact
+======
+
+The default value is set to 1, so it's backward compatible.
\ No newline at end of file
index 3bd9426..1e747c4 100644 (file)
@@ -428,13 +428,14 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                } else {
                        // Else the page:
                        // Prepare search words for markup in content:
-                       if ($this->settings['forwardSearchWordsInResultLink']) {
-                               $markUpSwParams = array('no_cache' => 1);
+                       $markUpSwParams = array();
+                       if ($this->settings['forwardSearchWordsInResultLink']['_typoScriptNodeValue']) {
+                               if ($this->settings['forwardSearchWordsInResultLink']['no_cache']) {
+                                       $markUpSwParams = array('no_cache' => 1);
+                               }
                                foreach ($this->searchWords as $d) {
                                        $markUpSwParams['sword_list'][] = $d['sword'];
                                }
-                       } else {
-                               $markUpSwParams = array();
                        }
                        $title = $this->linkPage($row['data_page_id'], $title, $row, $markUpSwParams);
                }
index 9884176..e678f8a 100755 (executable)
@@ -1696,7 +1696,11 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // Else the page:
                        // Prepare search words for markup in content:
                        if ($this->conf['forwardSearchWordsInResultLink']) {
-                               $markUpSwParams = array('no_cache' => 1);
+                               if ($this->conf['forwardSearchWordsInResultLink.']['no_cache']) {
+                                       $markUpSwParams = array('no_cache' => 1);
+                               } else {
+                                       $markUpSwParams = array();
+                               }
                                foreach ($this->sWArr as $d) {
                                        $markUpSwParams['sword_list'][] = $d['sword'];
                                }
index 779b2df..00e78ae 100644 (file)
@@ -37,6 +37,7 @@ plugin.tx_indexedsearch {
                searchSkipExtendToSubpagesChecking = 0
                exactCount = 0
                forwardSearchWordsInResultLink = 0
+               forwardSearchWordsInResultLink.no_cache = 1
 
                # various crop/offset settings for single result items
                results {
index 0000535..c21352f 100644 (file)
@@ -97,6 +97,7 @@ plugin.tx_indexedsearch {
        }
 */
        forwardSearchWordsInResultLink = 0
+       forwardSearchWordsInResultLink.no_cache = 1
        linkSectionTitles = 1
 
        # Setting default values for piVars (please see the source code for the form-field names which you can preset values for here)