Task #70849

Make Searchlevels in Live- and Listsearch constistend

Added by Marcus Schwemer almost 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2015-10-19
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Right now the number of search levels are hardcoded in the livesearch and somehow in the search in the list module.

Livesearch

Using the livesearch, results are displayed for the complete website in the suggest box. If you click on "Show all" the search is limited to the 4 levels starting at page uid 0. If now your suggested search results are on level 5 or higher, the list search does not show them. The results in list search must reflect the results in the live search.

See file "typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js" on line 90:

88   $(containerSelector).on('click', '.t3js-live-search-show-all', function(evt) {
89       evt.preventDefault();
90       TYPO3.ModuleMenu.App.showModule('web_list', 'id=0&search_levels=4&search_field=' + encodeURIComponent($(searchFieldSelector).val()));
91   });

Possible Solutions:

  • Workaround
    Change it to a unreal high number of levels, like 9.999.999.999
  • Bugfix
    Fix the the list search, so it allows infinite levels and make the number of levels independent from "EXT:lang/locallang_core.xlf"

Listsearch

The available number of levels that will be included in the search is dependent from the settings in "EXT:lang/locallang_core.xlf"

Yes, you read it right ... if you change the label "labels.enterSearchLevels" to the following value

            <trans-unit id="labels.enterSearchLevels">
                <source>This page|1 level down|2 levels down|3 levels down|4 levels down|10 levels down</source>
            </trans-unit>

it will include 5 levels.

The reason is in file "/typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php" on line 551, where the label is converted into an array and used for generating the drop down on lines 552 - 554.

This should have an option that allows to search infinite levels in order to make it consistent with the live search.

BTW: This behaviour is also there in TYPO3 6.2LTS


Related issues

Precedes TYPO3 Core - Bug #76432: Live-Search is broken for editors Closed 2016-06-02

Associated revisions

Revision c2eb96d8 (diff)
Added by Marcus Schwemer over 3 years ago

[TASK] Make search levels in live search and list search consistent

Live search searches through the whole system, while list search
is limited to four levels.
Solution:
  • Add default pageTS for search levels
  • Live search "Show all" now uses "-1" for infinite search

Resolves: #70849
Releases: master
Change-Id: Ibf8b043da26e58bbe0df18fb2013934da5ec64f3
Reviewed-on: https://review.typo3.org/44171
Reviewed-by: Daniel Maier <>
Tested-by: Daniel Maier <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Marcus Schwemer almost 4 years ago

Thought about a clean solution.

What about this: We add an pageTS - option "mod.web_list.searchLevels"

mod.web_list.searchLevels {
   0 = EXT:lang/locallang_core.xlf:thisPage
   1 = EXT:lang/locallang_core.xlf:1level
   2 = EXT:lang/locallang_core.xlf:2levels
   3 = EXT:lang/locallang_core.xlf:3levels
   4 = EXT:lang/locallang_core.xlf:4levels
   infinite = EXT:lang/locallang_core.xlf:inifite
}

where 0..4 reflect the current status. The new one is "infinite" which is necessary to be consistent with the livesearch.

If somebody wants to add custom levels, (s)he can add additional values with custom labels via pageTS, where the id will be used as the depth of search-levels.

The "show all" button of the live search must always use the "infinite" id.

What do you think?

Kind regards
Marcus

BTW: In order to find a constistent solution for all searches, I checked the search in "mod.web_layout" The rendering of search results in "mod.web_layout" is completley broken ... I'll add another issue.

#2 Updated by Gerrit Code Review almost 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#3 Updated by Gerrit Code Review almost 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#4 Updated by Gerrit Code Review almost 4 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#5 Updated by Gerrit Code Review almost 4 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#6 Updated by Gerrit Code Review almost 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#7 Updated by Gerrit Code Review almost 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#8 Updated by Gerrit Code Review almost 4 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#9 Updated by Gerrit Code Review almost 4 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#10 Updated by Gerrit Code Review almost 4 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#11 Updated by Markus Sommer almost 4 years ago

  • Assignee set to Marcus Schwemer

#12 Updated by Gerrit Code Review over 3 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#13 Updated by Gerrit Code Review over 3 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44171

#14 Updated by Marcus Schwemer over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#15 Updated by Riccardo De Contardi almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF