[BUGFIX] Make hidden records searchable in top search 45/56145/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 14 Mar 2018 07:06:06 +0000 (08:06 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 14 Mar 2018 10:08:29 +0000 (11:08 +0100)
Hidden records must be found by the top search again.

Resolves: #84248
Releases: master, 8.7
Change-Id: Ic41eff5ab3300746c7fe6a78f9ce2a305372f7ab
Reviewed-on: https://review.typo3.org/56145
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php

index be4ee14..25b1aad 100644 (file)
@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
 use TYPO3\CMS\Core\Database\Query\QueryHelper;
+use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
@@ -183,6 +184,7 @@ class LiveSearch
         if (!empty($fieldsToSearchWithin)) {
             $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
                 ->getQueryBuilderForTable($tableName);
+            $queryBuilder->getRestrictions()->removeByType(HiddenRestriction::class);
 
             $queryBuilder
                 ->select('*')