Skip to content
Snippets Groups Projects
Commit 92d1d32d authored by Christoph Lehmann's avatar Christoph Lehmann Committed by Oliver Bartsch
Browse files

[BUGFIX] Add server request to view in ConfirmationFinisher

Since #98377 it is not possible to use `f:link.page`
ViewHelper in the ConfirmationFinisher template.

This adds the server request to the standalone view
to make it work again.

Also removed wrong comment and direct usage of global
request object.

Resolves: #103368
Releases: main, 12.4
Change-Id: I3822cda0bb5fde9feb992696775051ec676592c8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83433


Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 28500f1a
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ class StandaloneView extends AbstractTemplateView
}
/**
* @internal Currently used especially in functional tests. May change.
* @internal
*/
public function setRequest(?ServerRequestInterface $request = null): void
{
......
......@@ -126,6 +126,7 @@ class ConfirmationFinisher extends AbstractFinisher
protected function initializeStandaloneView(FormRuntime $formRuntime): StandaloneView
{
$standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
$standaloneView->setRequest($this->finisherContext->getRequest());
if (!isset($this->options['templateName'])) {
throw new FinisherException(
......
......@@ -17,7 +17,6 @@ declare(strict_types=1);
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 @@ class EmailFinisher extends AbstractFinisher
$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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment