[+TASK] Extbase (Persistence): Fixed a problem where additional WHERE clauses were...
authorJochen Rau <j.rau@web.de>
Mon, 31 May 2010 12:46:34 +0000 (12:46 +0000)
committerJochen Rau <j.rau@web.de>
Mon, 31 May 2010 12:46:34 +0000 (12:46 +0000)
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php

index 8772a88..862c688 100644 (file)
@@ -277,7 +277,8 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                $this->parseOrderings($query->getOrderings(), $source, $sql);
                $this->parseLimitAndOffset($query->getLimit(), $query->getOffset(), $sql);
 
-               foreach (array_keys($sql['tables']) as $tableName) {
+               $tableNames = array_unique(array_keys($sql['tables'] + $sql['unions']));
+               foreach ($tableNames as $tableName) {
                        if (is_string($tableName) && strlen($tableName) > 0) {
                                $this->addAdditionalWhereClause($query->getQuerySettings(), $tableName, $sql);
                        }