Skip to content

Commit

Permalink
w[BUGFIX] add TYPO3 v11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichmathes committed Oct 11, 2023
1 parent 8a73696 commit a16a79f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/Middleware/StyleguideRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ public function process(
// Create view
$view = $this->container->get(StandaloneView::class);

if ((new Typo3Version())->getMajorVersion() < 12) {
$view->getRenderingContext()->setControllerName('Styleguide');
$view->getRenderingContext()->setControllerAction($actionName);
}

$extbaseAttribute = new ExtbaseRequestParameters();
$extbaseAttribute->setControllerExtensionName('fluidStyleguide');
$extbaseAttribute->setControllerName('Styleguide');
Expand All @@ -168,9 +173,9 @@ public function process(

if ((new Typo3Version())->getMajorVersion() >= 12) {
$request = $request->withAttribute('frontend.typoscript', new FrontendTypoScript(new RootNode(), []));
$view->setRequest($request);
}

$view->setRequest($request);
$controller->setRequest($request);

// set the global, since some ViewHelper still fallback to $GLOBALS['TYPO3_REQUEST']
Expand Down

0 comments on commit a16a79f

Please sign in to comment.