Actions
Bug #88756
closedTypoScript – Symfony Expressions: request.getQueryParams() should do an "is defined" validation
Start date:
2019-07-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
symfony, expression,CodingNight
Complexity:
Is Regression:
Sprint Focus:
Description
[request.getQueryParams()['tx_news_pi1']['news'] > 0]
do something
[END]
This is working well – as long as the query parameter exists. If it doesn’t, the following error message will be written into the log file:
... {"expression":"request.getQueryParams()['tx_news_pi1']['news'] > 0","exception":"RuntimeException: Unable to get an item on a non-array. in ...
I have tried changing the condition as follows, hoping that it would be interpreted as “is defined” – but the results are exactly the same:
[request.getQueryParams()['tx_news_pi1']['news']]
In my view there should be an automated PHP isset() validation for such conditions. Or at least a way to actively check for “is defined
” as you can do in Symfony’s Twig templating engine for example. I couldn’t find a similar way for TypoScript – please enlighten me if I just missed it.
Actions