diff --git a/Classes/Service/InfoWindowContentService.php b/Classes/Service/InfoWindowContentService.php index 8f9e205f..d2fb9e39 100644 --- a/Classes/Service/InfoWindowContentService.php +++ b/Classes/Service/InfoWindowContentService.php @@ -80,7 +80,23 @@ private function renderInfoWindowContent(array $poiCollectionRecord, ServerReque $view = $this->createView($maps2TypoScript, $siteSettings, $request); $view->assignMultiple($variables); - return $view->render(); + return $this->renderView($view, $request); + } + + /** + * ToDo: Remove with TYPO3 15. f:transform.html calls LinkFactory::createUri() without cObj, which falls back + * to $GLOBALS['TYPO3_REQUEST']. It is not set within middlewares yet. Check, if f:format.html is an option. + */ + private function renderView(ViewInterface $view, ServerRequestInterface $request): string + { + $previousRequest = $GLOBALS['TYPO3_REQUEST'] ?? null; + $GLOBALS['TYPO3_REQUEST'] = $request; + + try { + return $view->render(); + } finally { + $GLOBALS['TYPO3_REQUEST'] = $previousRequest; + } } private function createView(