Project

General

Profile

Actions

Bug #89715

closed

Condition request.getNormalizedParams().getHttpHost() causes an error when cron runs schedular:run

Added by Markus Tröger about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2019-11-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I have a condition in the TypoScript like this:

[like(request.getNormalizedParams().getHttpHost(), "*.domain.com")]
    page.includeCSS.file99 = EXT:xskeleton/Resources/Public/Css/for-development-only.css
    page.includeJSFooter.file99 = EXT:xskeleton/Resources/Public/Js/for-development-only.js
[end]

This works totally fine in the frontend but when the schedular runs via cron the condition causes an error in the log file:

Tue, 19 Nov 2019 12:58:09 +0100 [ERROR] request="3d81e8292386f" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Unable to get a property on a non-object. - {"expression":"like(request.getNormalizedParams().getHttpHost(), \"*.domain.com\")","exception":"RuntimeException: Unable to get a property on a non-object. in /var/www/html/vendor/symfony/expression-language/Node/GetAttrNode.php:83

The problem is there is no request created within the schedular job. Therefore it turns out I can't use any of the conditions which based on a request. Isn't it a weird behaviour. I would expect the the condition just returns a FALSE.

Actions

Also available in: Atom PDF