[BUGFIX] Failing test translateForEmptyStringKeyReturnsNull()
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 20 Aug 2012 13:10:46 +0000 (15:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 20 Aug 2012 13:17:34 +0000 (15:17 +0200)
Since the rootline refactoring a test case fails. Solution is to only
call the rootline in backend mode if page id is not 0. This additionally
saves some cycles in backend context.

Change-Id: I224ae2655b06dfb1f239b06d6ac2cbb89206a7a8
Resolves: #39997
Related: #39352
Releases: 6.0
Reviewed-on: http://review.typo3.org/13966
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php

index 1f75e0f..3feb8f9 100644 (file)
@@ -47,10 +47,17 @@ class Tx_Extbase_Configuration_BackendConfigurationManager extends Tx_Extbase_Co
                                // do not log time-performance information
                        $template->tt_track = 0;
                        $template->init();
+
                                // Get the root line
-                       $sysPage = t3lib_div::makeInstance('t3lib_pageSelect');
-                               // get the rootline for the current page
-                       $rootline = $sysPage->getRootLine($this->getCurrentPageId());
+                       $rootline = array();
+                       $pageId = $this->getCurrentPageId();
+                       if ($pageId > 0) {
+                               /** @var $sysPage t3lib_pageSelect */
+                               $sysPage = t3lib_div::makeInstance('t3lib_pageSelect');
+                                       // Get the rootline for the current page
+                               $rootline = $sysPage->getRootLine($this->getCurrentPageId(), '', TRUE);
+                       }
+
                                // This generates the constants/config + hierarchy info for the template.
                        $template->runThroughTemplates($rootline, 0);
                        $template->generateConfig();