#91747frontend based TS conditions throw warning in Backend
Description
For example this:
@[123 in frontend.user.userGroupList]@
This adds the following log entry on every action done in the backend:
Core: Error handler (BE): PHP Warning: in_array() expects parameter 2 to be array, string given in .../vendor/symfony/expression-language/Node/BinaryNode.php line 100
Because frontend.user.userGroupList does not exist in BE context (because frontend does not exist in BE, obviously). The condition is working in FE and when simulating it in the template module! Its justs literally spams the log module.
Having this on 9.5.19. Flagged as regression, because on v8 such conditions (with old syntax) worked without error.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 5
-
S P changed subject
frontend based TS conditons throw warning in Backendfrontend based TS conditions throw warning in Backend 07/06/20, 10:56 -
S P commented 07/06/20, 11:13
-
S P commented 07/06/20, 12:52
Sorry, my mistake.
frontend.user.userGroupListis not array but a string. The correct usage would be[usergroup('123')].But still, TYPO3 should not pass strings to an array argument. It should rather throw a proper error log, like:
Type mismatch: tried to pass string, expected array on condition [123 in frontend.user.userGroupList] -
Oliver Hader commented and changed Is Regression
10 12/04/20, 15:37Does not look like a regression to me… Documentation on v9.5 changes can be found here: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.4/Feature-85829-ImplementSymfonyExpressionLanguageForTypoScriptConditions.html
-
Georg Ringer commented and changed status
NewClosed 06/05/24, 21:28please always use traverse and/or check the context, e.g. getTSFE
this is not a bug, even though I understand that it can be annoying. therefore closing it now
A workaround is to add
getTSFE() &&before every condition. The existance of such ugly workaround can be no excuse to not fix this bug, however.