Index: typo3/sysext/lowlevel/config/index.php =================================================================== --- typo3/sysext/lowlevel/config/index.php (revision 10660) +++ typo3/sysext/lowlevel/config/index.php (working copy) @@ -267,10 +267,20 @@ 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); + if ($var == 'TCA') { // check if we're editing the TCA + preg_match_all('/\[\'([^\']+)\'\]/', $line, $parts); + if ($parts[1][1] != 'ctrl') { // anything else than ctrl section requires to load TCA + $loadTCA = 't3lib_div::loadTCA(\'' . $parts[1][0] . '\');'; + if (strpos($extTables, $loadTCA) === false) { // check if the loadTCA statement is not already present in the file + $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 +288,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 {