Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exceptions when using UncacheViewHelper on TYPO3 12 #1872

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions Classes/Utility/RequestResolver.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace FluidTYPO3\Vhs\Utility;

/*
Expand All @@ -9,17 +10,14 @@
*/

use TYPO3\CMS\Extbase\Mvc\Request;
use TYPO3\CMS\Extbase\Mvc\RequestInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;

class RequestResolver
{
/**
* @return Request&RequestInterface
*/
public static function resolveRequestFromRenderingContext(
RenderingContextInterface $renderingContext
): RequestInterface {
): ServerRequestInterface {
$request = null;
if (method_exists($renderingContext, 'getRequest')) {
$request = $renderingContext->getRequest();
Expand Down
3 changes: 2 additions & 1 deletion Classes/View/UncacheTemplateView.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace FluidTYPO3\Vhs\View;

/*
Expand Down Expand Up @@ -40,7 +41,7 @@ public function callUserFunction(string $postUserFunc, array $conf): string

if (method_exists($renderingContext, 'setRequest')) {
$renderingContext->setRequest(
new Request($GLOBALS['TYPO3_REQUEST']->withAttribute('extbase', $parameters))
$GLOBALS['TYPO3_REQUEST']->withAttribute('extbase', $parameters)
);
}
} else {
Expand Down