[TASK] Set suggestWizard.searchWholePhrase default to TRUE 87/41587/4
authorFrans Saris <franssaris@gmail.com>
Fri, 17 Jul 2015 18:01:02 +0000 (20:01 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 19 Jul 2015 09:31:13 +0000 (11:31 +0200)
Resolves: #68290
Releases: master
Change-Id: Ib67ed25c8e4a787302582fffe8006879fcd51f08
Reviewed-on: http://review.typo3.org/41587
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php
typo3/sysext/core/Documentation/Changelog/master/Important-68290-DefaultBehaviorForTCASuggestWizardChanged.rst [new file with mode: 0644]

index e7ed88d..42f063a 100644 (file)
@@ -206,7 +206,7 @@ class SuggestWizardDefaultReceiver {
         * @return void
         */
        protected function prepareSelectStatement() {
-               $searchWholePhrase = $this->config['searchWholePhrase'];
+               $searchWholePhrase = !isset($this->config['searchWholePhrase']) || $this->config['searchWholePhrase'];
                $searchString = $this->params['value'];
                $searchUid = (int)$searchString;
                if ($searchString !== '') {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Important-68290-DefaultBehaviorForTCASuggestWizardChanged.rst b/typo3/sysext/core/Documentation/Changelog/master/Important-68290-DefaultBehaviorForTCASuggestWizardChanged.rst
new file mode 100644 (file)
index 0000000..50ca7aa
--- /dev/null
@@ -0,0 +1,37 @@
+===================================================================
+Important: #68290 - Default behavior for TCA suggest wizard changed
+===================================================================
+
+Description
+===========
+
+The suggest wizard searches now by default in the whole word instead only the beginning. This might have performance
+implications for large sites with a lot of records and/or sites that have a lot of tables that are searched, as the
+search is done with a ``LIKE "%searchterm%"``.
+
+To switch back to the old behavior add ``searchWholePhrase = FALSE`` to the config of the suggest wizard.
+
+Example to reset it for ``page.shortcut``:
+
+.. code-block:: php
+
+       'shortcut' => array(
+               'config' => array(
+                       'type' => 'group',
+                       'internal_type' => 'db',
+                       'allowed' => 'pages',
+                       'size' => '1',
+                       'maxitems' => '1',
+                       'minitems' => '0',
+                       'show_thumbs' => '1',
+                       'wizards' => array(
+                               'suggest' => array(
+                                       'type' => 'suggest',
+                                       'default' => array(
+                                               'additionalSearchFields' => 'nav_title, alias, url',
+                                               'searchWholePhrase' => FALSE
+                                       )
+                               )
+                       )
+               )
+       ),
\ No newline at end of file