Constants added via addTypoScriptConstants() are missing after clearing frontend cache
I received reports about an issue in my extension iconfont after clearing the fontend cache. I was able to reproduce it reliable and I think it is an issue in TYPO3 core.
In my extension I define typoscripts constants in ext_tables.php using ExtensionManagementUtility::addTypoScriptConstants().
When I clear the frontend cache and reload the page with the same browser the constants are still available and everthing works as expected. But if I clear the fontend cache in one browser and reload the page in another browser in which I am not logged in to the TYPO3 backend the constants are missing.
#1 Updated by Morton Jonuschat about 2 years ago
- Category deleted (
- Status changed from New to Rejected
Please see the extension architecture documentation: ext_tables.php is not always included in global scope (in the frontend) - https://docs.typo3.org/typo3cms/CoreApiReference/6.2/ExtensionArchitecture/ConfigurationFiles/
The API documentation for ExtensionManagementUtility::addTypoScriptConstants also states: FOR USE IN ext_localconf.php FILES
Moving the addTypoScriptConstants call to ext_localconf.php or adding the constants using ext_typoscript_constants.txt should solve the issue you have with your extension.
If you think that closing this issue is the wrong decision, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.