Project

General

Profile

Actions

Bug #91747

open

frontend based TS conditions throw warning in Backend

Added by Stefan P almost 4 years ago. Updated over 3 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2020-07-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
expression language typoscript condition frontend backend
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Stefan P almost 4 years ago

  • Subject changed from frontend based TS conditons throw warning in Backend to frontend based TS conditions throw warning in Backend
Actions #2

Updated by Stefan P almost 4 years ago

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.

Actions #3

Updated by Stefan P almost 4 years ago

Sorry, my mistake. frontend.user.userGroupList is 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]

Actions #4

Updated by Oliver Hader over 3 years ago

  • Is Regression changed from Yes to No
Actions

Also available in: Atom PDF