Issue Bug Closed

#91654Missing request.getNormalizedParams() in CLI context

Mario Lubenka 06/16/20, 15:10 updated 02/19/22, 16:05

Description

Using the request condition for comparing the HTTP host fails in CLI context.

Setup:

[request.getNormalizedParams().getHttpHost() == '9lts.ddev.site']
page.10 = TEXT
page.10.value = Hello World
[global]

Executing a console command like /var/www/html/bin/typo3cms extension:activate tika results in this error:

TYPO3 [ERROR] request="24a8a0f11c56c" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Unable to get a property on a non-object. - {"expression":"request.getNormalizedParams().getHttpHost() == '9lts.ddev.site'","exception":"RuntimeException: Unable to get a property on a non-object. in \/var\/www\/html\/vendor\/symfony\/expression-language\/Node\/GetAttrNode.php:83

We’re using TYPO3 CMS 9.5.18 (haven’t seen a fix in 9.5.19).

According to documentation the `request` condition should work in all contexts. Or does that not include CLI?

Setting it to [request.getNormalizedParams() || request.getNormalizedParams().getHttpHost() == '9lts.ddev.site'] resolves the error, so I believe getNormalizedParams() is null.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.