[BUGFIX] Add missing AND concatenation in generated SQL statement 40/55840/2
authorNicole Cordes <typo3@cordes.co>
Tue, 20 Feb 2018 18:48:24 +0000 (19:48 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 8 Mar 2018 09:35:58 +0000 (10:35 +0100)
This patch adds a missing AND concatenation in
\TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList::makeQueryArray.
As the search string is returned as plain SQL constraint and is added
to an already existing statement, it needs to be prefix with "AND".

Resolves: #83984
Releases: 8.7
Change-Id: I9b62a26f39b0899a1b6e3549eb4a6a488ad1aaac
Reviewed-on: https://review.typo3.org/55840
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php

index dd833e7..6edaccf 100644 (file)
@@ -727,6 +727,9 @@ class AbstractDatabaseRecordList extends AbstractRecordList
         $pC = $table === 'pages' && $this->perms_clause ? ' AND ' . $this->perms_clause : '';
         // Adding search constraints:
         $search = $this->makeSearchString($table, $id);
+        if ($search !== '') {
+            $search = ' AND ' . $search;
+        }
         // Compiling query array:
         $queryParts = [
             'SELECT' => $fieldList,