Project

General

Profile

Actions

Bug #106696

closed

Base variants request context missing

Added by Josua Vogel about 1 month ago. Updated 7 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Start date:
2025-05-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
8.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

According to the documentation (https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/BaseVariants.html), all functions from DefaultFunctionsProvider.php can be used in the condition for baseVariants.

If you use the ip condition, e.g. ip(“devIp”), the call fails.

#1686745105 RuntimeException
Using expression language function “ip(devIp)” in a context without request.
Actions #1

Updated by Garvin Hicking 22 days ago

  • Status changed from New to Closed

Thanks for the report! We discussed this and believe this to be a documentation issue, so I created this:

https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/5670

Actions #2

Updated by Stefan Froemken 7 days ago

I would prefer solving this issue on core side. Something like that:

$this->expressionLanguageVariables = [
    'applicationContext' => (string)Environment::getContext(),
    'typo3' => $typo3,
    'date' => $context->getAspect('date'),
    'request' => new RequestWrapper($GLOBALS['TYPO3_REQUEST'] ?? null),
    'features' => $features,
];
Actions

Also available in: Atom PDF