[+BUGFIX] Extbase (Configuration): change the order of methods to determine the curre...
authorFranz Koch <typo3@elements-net.de>
Wed, 1 Dec 2010 12:35:09 +0000 (12:35 +0000)
committerFranz Koch <typo3@elements-net.de>
Wed, 1 Dec 2010 12:35:09 +0000 (12:35 +0000)
typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php

index d2c806f..da2bb6e 100644 (file)
@@ -111,18 +111,18 @@ class Tx_Extbase_Configuration_BackendConfigurationManager extends Tx_Extbase_Co
                        return $pageId;
                }
 
-                       // get root template
-               $rootTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1');
-               if (count($rootTemplates) > 0) {
-                       return $rootTemplates[0]['pid'];
-               }
-
                        // get current site root
                $rootPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1');
                if (count($rootPages) > 0) {
                        return $rootPages[0]['uid'];
                }
 
+                       // get root template
+               $rootTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1');
+               if (count($rootTemplates) > 0) {
+                       return $rootTemplates[0]['pid'];
+               }
+
                        // fallback
                return self::DEFAULT_BACKEND_STORAGE_PID;
        }