[BUGFIX] Extbase (Persistence): TYPO3DbBackend->addEnableFieldsStatement is now Backe...
authorJochen Rau <j.rau@web.de>
Thu, 30 Jul 2009 22:49:44 +0000 (22:49 +0000)
committerJochen Rau <j.rau@web.de>
Thu, 30 Jul 2009 22:49:44 +0000 (22:49 +0000)
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php

index 7ebc3c3..1fd94e1 100644 (file)
@@ -494,9 +494,12 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
         * @return void
         */
        protected function addEnableFieldsStatement($selectorName, array &$sql) {
-               // TODO We have to call the appropriate API method if we are in TYPO3BE mode
                if (is_array($GLOBALS['TCA'][$selectorName]['ctrl'])) {
-                       $statement = substr($GLOBALS['TSFE']->sys_page->enableFields($selectorName), 5);
+                       if (TYPO3_MODE === 'FE') {
+                               $statement = substr($GLOBALS['TSFE']->sys_page->enableFields($selectorName), 5);
+                       } else { // TYPO3_MODE === 'BE'
+                               $statement = substr(t3lib_BEfunc::BEenableFields($selectorName), 5);
+                       }
                        if(!empty($statement)) {
                                $sql['enableFields'][] = $statement;
                        }