Issue Bug Closed

#85867@import in addPageTSConfig does not work correctly

Kevin Appelt 08/15/18, 18:05 updated 10/02/18, 10:30

Description

There seems to be a problem with the new import syntax (in the current dev-master) if you use it in ext_localconf.php.

TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
    '@import \'EXT:myextension/Configuration/TsConfig/Page.tsconfig\''
);
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig(
    '@import \'EXT:myextension/Configuration/TsConfig/User.tsconfig\''
);

The part with addPageTSConfig is the flaky part. The method addUserTSConfig is working as expected.
The same import with the old syntax is working as expected.

This is what i can see in the backend (whole line is dark red like all [global] lines):

[GLOBAL]### @import 'EXT:myextension/Configuration/TsConfig/Page.tsconfig' begin ###

followed by the imported code (which has working @includes) which gets completely ignored.

Same problem if i add a new line in front of it like so:

TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
    '
@import \'EXT:myextension/Configuration/TsConfig/Page.tsconfig\''
);

So solve the problem I have to add a random line in front of the @import – like so:

TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
    'thisisfordebuggingreasons = 1
    @import \'EXT:myextension/Configuration/TsConfig/Page.tsconfig\''
);

with this result (yes, no new line before the ###)

[GLOBAL]
thisisfordebuggingreasons = 1### @import 'EXT:myextension/Configuration/TsConfig/Page.tsconfig' begin ###

again followed by the imported code (which has working @includes) which get not ignored now.

Reviews 1