1
votes

I'm updating an old instance of TYPO3 (6.x) to TYPO3 9.5. Every time I load the page, I get complaints in the log file, for example:

[WARNING] request="bc60e12f63cf8" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed, fallback kicks in. It looks like an old condition with only one equal sign. - {"expression":"globalVar = TSFE : beUserLogin > 0"}

Since Version 9, TYPO uses a nex expression language for Typoscript called Symfony. I found good documentation on it. However, I couldn't find any documentation on the old syntax.

[globalVar = TSFE : beUserLogin > 0]
[globalVar = GP:L = 1]
[globalString = IENV:HTTP_HOST=www.domain.de]

I suppose the "=" is the euqals operator and the error message already hints at how to fix it. However I don't know what the ":" in these statements is. I'm guessing it's either an "AND" or an "OR" operator. But I'm not sure. Any help in understanding these statements would greatly help me transfer them to the new standard.

1

1 Answers

2
votes

[globalVar = TSFE : beUserLogin > 0] Is the user logged in in backend?

[globalVar = GP:L = 1] Is the language UID equal 1?

[globalString = IENV:HTTP_HOST=www.domain.de] Is the environment host equal www.domain.de?

Old typoscript documentation can be found at the same place as the actual. Just change the version on the bottom of the left column. https://docs.typo3.org/m/typo3/reference-typoscript/6.2/en-us/Conditions/Reference/Index.html

Caring about this means that you would get values like HTTP_HOST by getenv() and you would retrieve GET/POST values with TYPO3CMSCoreUtilityGeneralUtility::_GP() (t3lib_div::_GP()). Finally a lot of values from the TSFE object are useful. In order to get those values for comparison with “globalVar” and “globalString” conditions, you prefix that variable’s name with either “IENV:”/”ENV:”, “GP:”, “TSFE:” or “LIT:” respectively. Still the “|” divider may be used to separate keys in arrays and/or objects. “LIT” means “literal” and the string after “:” is trimmed and returned as the value (without being divided by “|” or anything)

Note: Using the “IENV:” prefix is highly recommended to get server/environment variables which are system-independent. Basically this will get the value using TYPO3CMSCoreUtilityGeneralUtility::getIndpEnv() (t3lib_div::getIndpEnv()). With “ENV:” you get the raw output from getenv() which is not always the same on all systems!