1
votes

I have following typoscript condition:

[request.getNormalizedParams().getHttpHost() == 'www.domain.com' && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0 && {$const.pid.pageX} in tree.rootLineIds]

which throws this error in the TYPO3 log:

Thu, 24 Sep 2020 06:52:04 +0200 [ERROR] request="2fa420fbc8c67" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Unable to get a property on a non-object. - {"expression":"request.getNormalizedParams().getHttpHost() == 'www.domain.com' && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0 && 11 in tree.rootLineIds","exception":"RuntimeException: Unable to get a property on a non-object. in /var/www/typo3cms/typo3_src-10.4.8/vendor/symfony/expression-language/Node/GetAttrNode.php:83

The problem seems to be the request.getNormalizedParams().getHttpHost() when the cronjob calls typo3/sysext/core/bin/typo3 scheduler:run.

How can I get rid of the error in the log file?

1

1 Answers

1
votes

Changing the condition to the following removes the entries from the log file:

[request.getNormalizedParams() && request.getNormalizedParams().getHttpHost() == 'www.domain.com' && traverse(request.getQueryParams(), 'tx_news_pi1/news') > 0 && {$const.pid.pageX} in tree.rootLineIds]

So I just added the request.getNormalizedParams() && at the beginning of the condition.