[BUGFIX] Warning empty $GLOBALS['TCA'] in rootline utility 00/19200/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 22 Mar 2013 18:51:56 +0000 (19:51 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 22 Mar 2013 19:57:31 +0000 (20:57 +0100)
The TCA refactoring of issue #45767 introduced a warning in the
rootline utility: Rootline resolving is called by determineID in
index_ts. At this point in bootstrap the TCA was not loaded yet.
The patch just moves the TCA includes prior to determineID.

Warning: This leads to an earlier execution of ext_tables.php if
caches are empty. 6.0 did that too, it called includeTca()
in RootlineUtility to circumvent the same issue, the current patch
just solves the issue in a cleaner way. But still, this might lead
to problems if ext_tables.php code relies for example on the setup
done by determineID or the other code in between. The risk this
breaks something is pretty low, though.

Change-Id: I83e6367dbb4654fe0bf957bbe817fa6d5b5ea106
Resolves: #46156
Related: #45767
Releases: 6.1
Reviewed-on: https://review.typo3.org/19200
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/index_ts.php

index afe434b..dac3909 100644 (file)
@@ -95,24 +95,26 @@ if ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib')) {
        }
        ob_start(array(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Utility\\CompressionUtility'), 'compressionOutputHandler'));
 }
+
 // FE_USER
 $TT->push('Front End user initialized', '');
-/**
- * @var $TSFE \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
- */
+/** @var $TSFE \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
 $TSFE->initFEuser();
 $TT->pull();
+
 // BE_USER
-/**
- * @var $BE_USER \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
- */
+/** @var $BE_USER \TYPO3\CMS\Backend\FrontendBackendUserAuthentication */
 $BE_USER = $TSFE->initializeBackendUser();
+
 // Process the ID, type and other parameters
 // After this point we have an array, $page in TSFE, which is the page-record of the current page, $id
 $TT->push('Process ID', '');
 // Initialize admin panel since simulation settings are required here:
 if ($TSFE->isBackendUserLoggedIn()) {
        $BE_USER->initializeAdminPanel();
+       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
+} else {
+       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
 }
 $TSFE->checkAlternativeIdMethods();
 $TSFE->clear_preview();
@@ -134,7 +136,6 @@ $TT->pull();
 
 // Admin Panel & Frontend editing
 if ($TSFE->isBackendUserLoggedIn()) {
-       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
        $BE_USER->initializeFrontendEdit();
        if ($BE_USER->adminPanel instanceof \TYPO3\CMS\Frontend\View\AdminPanelView) {
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject();
@@ -142,8 +143,6 @@ if ($TSFE->isBackendUserLoggedIn()) {
        if ($BE_USER->frontendEdit instanceof \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController) {
                $BE_USER->frontendEdit->initConfigOptions();
        }
-} else {
-       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
 }
 
 // Starts the template