[+BUGFIX] Extbase (Persistence): Added a missing hasPIDColumn check. Resolves #4979.
authorSebastian Kurfürst <sebastian@typo3.org>
Mon, 26 Oct 2009 06:24:44 +0000 (06:24 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Mon, 26 Oct 2009 06:24:44 +0000 (06:24 +0000)
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php

index 8fdd2cc..b0d2c74 100644 (file)
@@ -549,7 +549,7 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
         * @return void
         */
        protected function addPageIdStatement($tableName, array &$sql) {
-               if (is_array($GLOBALS['TCA'][$tableName]['ctrl'])) {
+               if (is_array($GLOBALS['TCA'][$tableName]['ctrl']) && $this->dataMapper->getDataMap($tableName)->hasPidColumn()) {
                        $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
                        $sql['additionalWhereClause'][] = $tableName . '.pid IN (' . implode(', ', t3lib_div::intExplode(',', $extbaseFrameworkConfiguration['persistence']['storagePid'])) . ')';
                }
@@ -582,7 +582,7 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                                $className = '';
                                if ($source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
                                        $className = $source->getNodeTypeName();
-                               }                       
+                               }
                                $columnName = $this->dataMapper->convertPropertyNameToColumnName($operand->getPropertyName(), $className);
                                if (strlen($tableName) > 0) {
                                        $sql['orderings'][] = $tableName . '.' . $columnName . ' ' . $order;