Feature #92979
openMissing TypoScript constants are treated as strings
0%
Description
This has probably been the behaviour of the TS parser since forever, but IMHO it is very confusing.
When a TS constant is not defined, it is treated in the setup as a string.
This causes various hickups, since conditions "if a constant is defined" don't work, any other usages like in TEXT values etc. also just output the constant name as a string.
The condition documentation only shows usecases with comparison to integers or strings, and these usecases are covered, since the value is the constant string itself. But there is no way to simply check for the existence.
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/#constant
If i only need the constant in e.g. one language, i have to first initialize it with an empty value, then it can be set in the condition.
Now it is always replaced and i can check the constant to be empty or filled. IMHO it should always be empty in the TS if it is not defined.