diff --git a/typo3/sysext/fluid/Classes/View/StandaloneView.php b/typo3/sysext/fluid/Classes/View/StandaloneView.php index 00c15f360b67..5e5767011c08 100644 --- a/typo3/sysext/fluid/Classes/View/StandaloneView.php +++ b/typo3/sysext/fluid/Classes/View/StandaloneView.php @@ -66,7 +66,7 @@ public function getFormat() } /** - * @internal Currently used especially in functional tests. May change. + * @internal */ public function setRequest(?ServerRequestInterface $request = null): void { diff --git a/typo3/sysext/form/Classes/Domain/Finishers/ConfirmationFinisher.php b/typo3/sysext/form/Classes/Domain/Finishers/ConfirmationFinisher.php index 9092fb5f36b2..dc5f40f6f4c3 100644 --- a/typo3/sysext/form/Classes/Domain/Finishers/ConfirmationFinisher.php +++ b/typo3/sysext/form/Classes/Domain/Finishers/ConfirmationFinisher.php @@ -126,6 +126,7 @@ protected function executeInternal() protected function initializeStandaloneView(FormRuntime $formRuntime): StandaloneView { $standaloneView = GeneralUtility::makeInstance(StandaloneView::class); + $standaloneView->setRequest($this->finisherContext->getRequest()); if (!isset($this->options['templateName'])) { throw new FinisherException( diff --git a/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php b/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php index 395e6a84f600..f81d9ccb1c25 100644 --- a/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php +++ b/typo3/sysext/form/Classes/Domain/Finishers/EmailFinisher.php @@ -17,7 +17,6 @@ namespace TYPO3\CMS\Form\Domain\Finishers; -use Psr\Http\Message\ServerRequestInterface; use Symfony\Component\Mime\Address; use TYPO3\CMS\Core\Mail\FluidEmail; use TYPO3\CMS\Core\Mail\MailerInterface; @@ -203,12 +202,8 @@ protected function initializeFluidEmail(FormRuntime $formRuntime): FluidEmail $this->options['templateName'] = 'Default'; } - // Set the PSR-7 request object if available - if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface) { - $fluidEmail->setRequest($GLOBALS['TYPO3_REQUEST']); - } - $fluidEmail + ->setRequest($this->finisherContext->getRequest()) ->setTemplate($this->options['templateName']) ->assignMultiple([ 'finisherVariableProvider' => $this->finisherContext->getFinisherVariableProvider(),