Constant Editor Template matches all conditions
Hello TYPO3 Community,
i was these days facing a weird problem until i found out the reason for it. I'm not sure if this is done on purpose, so might also be a weird feature.
When using conditions in a constants.ts template you will (after a long time) realize that all typoscript conditions match, which will cause the last statement of a constant to be always shown as default/fallback value in constant editor.
[applicationContext = Production/Stage] some.var = stage [global] [applicationContext = Production/Live] some.var = live [global] [applicationContext = Development] some.var = dev [global]
When it comes to the frontend everything will be fine and "some.var" will be different depending on applicationContext. But when it comes to the constant editor in the backend it will show always "live", since for some reason all conditions match. This is caused by following:
/typo3/cms/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php on line 341 in "generateConfig_constants" where it calls: $matchObj->setSimulateMatchResult(true);
By commenting this line out you will get the correct result in the backend.
This might have the reason, that there could be conditions that are only matchable in frontend like GP:L = 2 and this might get confusing then in backend context. Still i think that it brings 300% more confusion if we just take the last statement not matter what condition :/
What do you think about removing this line?
Rozbeh Chiryai Sharahi