Index: typo3/sysext/lowlevel/config/index.php =================================================================== --- typo3/sysext/lowlevel/config/index.php (revision 10658) +++ typo3/sysext/lowlevel/config/index.php (working copy) @@ -267,10 +267,22 @@ if (t3lib_div::_GP('writetoexttables')) { // Write the line to extTables.php // change value to $GLOBALS $length = strpos($line, '['); - $var = substr($line, 0, $length); + $var = substr($line, 1, $length-1); $changedLine = '$GLOBALS[\'' . substr($line, 1, $length - 1) . '\']' . substr($line, $length); - // insert line in extTables.php + // load current extTables.php $extTables = t3lib_div::getURL(PATH_typo3conf . TYPO3_extTableDef_script); + // check if we're editing the TCA + if ($var == 'TCA') { + preg_match_all("/\['([^']+)'\]/", $line, $parts); + // anything else than ctrl section requires a loadTCA() + if ($parts[1][1] != 'ctrl') { + $loadTCA = 't3lib_div::loadTCA(\'' . $parts[1][0] . '\');'; + // check if the loadTCA statement is not already present in the file + if (strpos($extTables, $loadTCA) === false) + $changedLine = $loadTCA . "\n" . $changedLine; + } + } + // insert line in extTables.php $extTables = '/is', '', $extTables) . $changedLine . LF . '?>'; $success = t3lib_div::writeFile(PATH_typo3conf . TYPO3_extTableDef_script, $extTables); if ($success) { @@ -278,7 +290,7 @@ $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', '', - sprintf($GLOBALS['LANG']->getLL('writeMessage', TRUE), TYPO3_extTableDef_script, '
', '' . $changedLine . ''), + sprintf($GLOBALS['LANG']->getLL('writeMessage', TRUE), TYPO3_extTableDef_script, '
', '' . nl2br($changedLine) . ''), t3lib_FlashMessage::OK ); } else {