From 2ef76e6178060560522d18b2901a815998008f28 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Wed, 22 Dec 2021 13:44:23 +0100
Subject: [PATCH] [TASK] Correct order of extbase view setup

With the removal of ControllerContext a view
init call had to be moved out of ControllerContext.
It was moved to a wrong place in the view setup
chain. This is fixed by the patch.

Resolves: #96426
Related: #96183
Releases: main
Change-Id: I8a49627040a72649c39aa8ace9da0b0a2e1995c1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72771
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../sysext/extbase/Classes/Mvc/Controller/ActionController.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
index 1d749318beac..e57d05cb2e99 100644
--- a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
+++ b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
@@ -545,6 +545,7 @@ abstract class ActionController implements ControllerInterface
             $this->request->getControllerActionName(),
             $this->request->getFormat()
         );
+        $this->setViewConfiguration($view);
         if ($view instanceof AbstractTemplateView) {
             $renderingContext = $view->getRenderingContext();
             if ($renderingContext instanceof RenderingContext) {
@@ -554,8 +555,6 @@ abstract class ActionController implements ControllerInterface
             $templatePaths->fillDefaultsByPackageName($this->request->getControllerExtensionKey());
             $templatePaths->setFormat($this->request->getFormat());
         }
-
-        $this->setViewConfiguration($view);
         if (method_exists($view, 'injectSettings')) {
             $view->injectSettings($this->settings);
         }
-- 
GitLab