From fa08e0f4171cec611311a28b0f5c87e5420a67b0 Mon Sep 17 00:00:00 2001
From: Oliver Hader <oliver@typo3.org>
Date: Mon, 24 Oct 2011 23:53:30 +0200
Subject: [PATCH] [BUGFIX] Internal extension information is not updated
 properly

tx_em_Tools::refreshGlobalExtList() is triggered on installing
extensions. However the current implementation is wrong (early
return) and does not consider $TYPO3_CONF_VARS.

This misbehavior also prevents the Introduction Package to
correctly install accordant cf_* tables of workspaces and
extbase, since the information in $TYPO3_CONF_VARS is not
available globally.

Change-Id: I3a1b8ea9d2da40a52d9838ac8b1fe9551b6dfed8
Fixes: #31246
Reviewed-on: http://review.typo3.org/6270
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
---
 .../em/classes/tools/class.tx_em_tools.php     | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/typo3/sysext/em/classes/tools/class.tx_em_tools.php b/typo3/sysext/em/classes/tools/class.tx_em_tools.php
index 616de29972d2..4618a8c53159 100644
--- a/typo3/sysext/em/classes/tools/class.tx_em_tools.php
+++ b/typo3/sysext/em/classes/tools/class.tx_em_tools.php
@@ -135,22 +135,16 @@ final class tx_em_Tools {
 	 * @return void
 	 */
 	public static function refreshGlobalExtList() {
-		global $TYPO3_LOADED_EXT;
-
-		$TYPO3_LOADED_EXT = t3lib_extMgm::typo3_loadExtensions();
-		if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
-			require(PATH_typo3conf . $TYPO3_LOADED_EXT['_CACHEFILE'] . '_ext_localconf.php');
-		}
-		return;
-
 		$GLOBALS['TYPO3_LOADED_EXT'] = t3lib_extMgm::typo3_loadExtensions();
-		if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
-			require(PATH_typo3conf . $TYPO3_LOADED_EXT['_CACHEFILE'] . '_ext_localconf.php');
+		if ($GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE']) {
+			require(PATH_typo3conf . $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'] . '_ext_localconf.php');
 		} else {
-			$temp_TYPO3_LOADED_EXT = $TYPO3_LOADED_EXT;
+			$temp_TYPO3_LOADED_EXT = $GLOBALS['TYPO3_LOADED_EXT'];
 			foreach ($temp_TYPO3_LOADED_EXT as $_EXTKEY => $temp_lEDat) {
 				if (is_array($temp_lEDat) && $temp_lEDat['ext_localconf.php']) {
-					$_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];
+						// Make sure $TYPO3_CONF_VARS is also available within the included files
+					global $TYPO3_CONF_VARS;
+					$_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
 					require($temp_lEDat['ext_localconf.php']);
 				}
 			}
-- 
GitLab