[BUGFIX] Wrong query generation in extbase QueryParser 68/50368/4
authorGerrit Mohrmann <mohrmann.t3@gmx.de>
Tue, 25 Oct 2016 12:08:55 +0000 (14:08 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 27 Oct 2016 12:45:54 +0000 (14:45 +0200)
Fixes wrong constraint building in
convertQueryToDoctrineQueryBuilder()

Resolves: #78428
Related: #77379
Releases: master
Change-Id: Ie309b0da61e2129916eafd35860ff38efb6e8191
Reviewed-on: https://review.typo3.org/50368
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php

index 7295a84..071853a 100644 (file)
@@ -334,12 +334,10 @@ class Typo3DbQueryParser
                         $queryBuilderForSubselect->andWhere($additionalWhereForMatchFields);
                     }
 
                         $queryBuilderForSubselect->andWhere($additionalWhereForMatchFields);
                     }
 
-                    $this->queryBuilder->andWhere(
-                        $this->queryBuilder->expr()->comparison(
-                            $this->queryBuilder->quoteIdentifier($tableName . '.uid'),
-                            'IN',
-                            '(' . $queryBuilderForSubselect->getSQL() . ')'
-                        )
+                    return $this->queryBuilder->expr()->comparison(
+                        $this->queryBuilder->quoteIdentifier($tableName . '.uid'),
+                        'IN',
+                        '(' . $queryBuilderForSubselect->getSQL() . ')'
                     );
                 } elseif ($typeOfRelation === ColumnMap::RELATION_HAS_MANY) {
                     $parentKeyFieldName = $columnMap->getParentKeyFieldName();
                     );
                 } elseif ($typeOfRelation === ColumnMap::RELATION_HAS_MANY) {
                     $parentKeyFieldName = $columnMap->getParentKeyFieldName();