symfony 表达式语言的 TypoScript 条件抛出错误

TypoScript conditions with symfony expression language throws error

我有以下打字错误情况:

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

在 TYPO3 日志中抛出此错误:

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

问题似乎出在 cronjob 调用 typo3/sysext/core/bin/typo3 scheduler:run 时的 request.getNormalizedParams().getHttpHost()

如何消除日志文件中的错误?

将条件更改为以下将从日志文件中删除条目:

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

所以我只是在条件的开头添加了request.getNormalizedParams() &&