Issue Task Closed

#93577Enable the search box on sysfolders w/o any record

Xavier Perseguers 02/24/21, 08:19 updated 02/25/21, 10:31

Description

This problem has been reported by one of my editors, in TYPO3 v9.

Context

  • Module: Web > List

Normal Behaviour

  • Select a folder containing DB records
  • You can toggle the search box in the toolbar:
    searchbox.png

Limitation

  • Select a folder containing only subfolders but not any DB records
  • You cannot toggle the search box in the toolbar since the icon is gone!

Analysis

In \TYPO3\CMS\Recordlist\Controller\RecordListController:637 (https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/recordlist/Classes/Controller/RecordListController.php#L637) we have this condition to include the button in the toolbar:

if (!$this->modTSconfig['properties']['disableSearchBox'] && ($dblist->HTMLcode || !empty($dblist->searchString))) {

Since there are no DB records, TYPO3 thinks it’s not worth showing the button. This is logical if you keep the Search Levels to 1 single level but if you search on 2 or more levels, then it’s highly useful to keep the button since it allows for an editor to find a given record without knowing exactly where to look for it, by starting the search from some “higher level”, some enclosing folder!

Suggestion

--- typo3/sysext/recordlist/Classes/Controller/RecordListController.php  2021-02-24 09:17:49.000000000 +0100
+++ typo3/sysext/recordlist/Classes/Controller/RecordListController.php  2021-02-24 09:17:49.000000000 +0100
@@ -634,7 +634,7 @@
         // Setting up the buttons for docheader
         $dblist->getDocHeaderButtons($this->moduleTemplate);
         // search box toolbar
-        if (!$this->modTSconfig['properties']['disableSearchBox'] && ($dblist->HTMLcode || !empty($dblist->searchString))) {
+        if (!$this->modTSconfig['properties']['disableSearchBox']) {
             $this->content = $dblist->getSearchBox();
             $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox');

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.