[BUGFIX] TCA load regression in eid context 54/20554/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 May 2013 18:25:37 +0000 (20:25 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Mon, 20 May 2013 13:20:24 +0000 (15:20 +0200)
TCA refactoring in 6.1 misses an edge case:
Frontend index_ts loads TCA *after* eid is handled, so there is
no TCA loaded in eid context. Eid scripts that still need
TCA *should* call EidUtility::initTCA(), but some call instead
TSFE->includeTCA(). But includeTCA() is empty now and deprecated.

The patch adds a call to includeTCA() to load TCA, if
GLOBALS['TCA'] array is empty. This makes sure populating TCA
is done only once.

ext:caretaker_instance is affected by this, eg. test "Check
backend user accounts" needs TCA and fails without the patch.

Change-Id: Iaa70fe62e0eba9981e31379b853c968efe1d4cca
Resolves: #47993
Releases: 6.2, 6.1
Reviewed-on: https://review.typo3.org/20554
Reviewed-by: Markus Klein
Reviewed-by: Alexander Opitz
Reviewed-by: Stefan Neufeind
Tested-by: Alexander Opitz
Reviewed-by: Felix Kopp
Reviewed-by: Dmitry Dulepov
Tested-by: Markus Klein

index 499429e..1cbba81 100644 (file)
@@ -2454,11 +2454,19 @@ class TypoScriptFrontendController {
         * @param integer $TCAloaded Probably, keep hands of this value. Just don't set it.
         * @return void
         * @see getCompressedTCarray()
-        * @deprecated since 6.1, will be removed in two versions
+        * @deprecated since 6.1, will be removed in two versions. Obsolete in regular frontend, eid scripts should use \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA()
        public function includeTCA($TCAloaded = 1) {
                // Full TCA is always loaded during bootstrap in FE, this method is obsolete.
+               // Compatibility layer:
+               // The if below is NOT true in usual frontend (non eid) context, TCA is loaded by bootstrap.
+               // If an eid script calls this method to load TCA, use
+               // \TYPO3\CMS\Frontend\Utility\EidUtility::initTCA() instead.
+               if (!isset($GLOBALS['TCA']['pages'])) {
+                       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
+               }