[BUGFIX] Ensure PageRenderer singleton is set 09/41109/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 12 Jul 2015 13:10:37 +0000 (15:10 +0200)
committerNicole Cordes <typo3@cordes.co>
Sun, 12 Jul 2015 13:20:44 +0000 (15:20 +0200)
Before rendering _INT content objects, the page renderer is unserialized
and stored in a TypoScriptFrontendController property. However this new
object is not updated in the singleton store in GeneralUtility.

This leads to the situation that plugin code that (legally) just instantiate
the page renderer using GeneralUtility::makeInstance() receive the wrong object.

Make sure the singleton store is updated once the page renderer is unserialized
for _INT processing.

Releases: master, 6.2
Resolves: #68061
Change-Id: I162b8a4dc102ffd8cc0fcc4d21ccc271c861b187
Reviewed-on: http://review.typo3.org/41109
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 61140cc..eb4e65e 100644 (file)
@@ -987,15 +987,6 @@ class TypoScriptFrontendController {
                return $this->pageRenderer;
        }
 
-       /**
-        * This is needed for USER_INT processing
-        *
-        * @param PageRenderer $pageRenderer
-        */
-       protected function setPageRenderer(PageRenderer $pageRenderer) {
-               $this->pageRenderer = $pageRenderer;
-       }
-
        /********************************************
         *
         * Initializing, resolving page id
@@ -3394,7 +3385,8 @@ class TypoScriptFrontendController {
                if (!empty($this->config['INTincScript_ext']['pageRenderer'])) {
                        /** @var PageRenderer $pageRenderer */
                        $pageRenderer = unserialize($this->config['INTincScript_ext']['pageRenderer']);
-                       $this->setPageRenderer($pageRenderer);
+                       $this->pageRenderer = $pageRenderer;
+                       GeneralUtility::setSingletonInstance(PageRenderer::class, $pageRenderer);
                }
 
                $this->recursivelyReplaceIntPlaceholdersInContent();