[BUGFIX] Ensure PageRenderer singleton is set 12/41112/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Sun, 12 Jul 2015 13:10:37 +0000 (15:10 +0200)
committerNicole Cordes <typo3@cordes.co>
Mon, 13 Jul 2015 08:29:01 +0000 (10:29 +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/41112
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index e279dee..fe73286 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Frontend\Controller;
  */
 
 use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
+use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Resource\StorageRepository;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
@@ -1077,9 +1078,9 @@ class TypoScriptFrontendController {
        /**
         * This is needed for USER_INT processing
         *
-        * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer
+        * @param PageRenderer $pageRenderer
         */
-       protected function setPageRenderer(\TYPO3\CMS\Core\Page\PageRenderer $pageRenderer) {
+       protected function setPageRenderer(PageRenderer $pageRenderer) {
                $this->pageRenderer = $pageRenderer;
        }
 
@@ -3632,7 +3633,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('TYPO3\\CMS\\Core\\Page\\PageRenderer', $pageRenderer);
                }
 
                $this->recursivelyReplaceIntPlaceholdersInContent();