[BUGFIX] getPageOverlay_preProcess respect changes done in hooks 79/48479/2
authorAndreas Allacher <andreas@allacher.com>
Tue, 3 May 2016 14:03:15 +0000 (16:03 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 7 Jun 2016 13:10:51 +0000 (15:10 +0200)
Due to the implementation of getPagesOverlay the individual page array
is passed to the getPageOverlay_preProcess hook without
being able to use changes done in user function
to the page array.
Now the page array can be modified again.
The change was introduced by adding the feature
PageRepository::getPagesOverlay() in http://review.typo3.org/36054

Change-Id: If4a07b232b3e34eb146f8ea06abe32efc7b72fdb
Releases: master, 7.6
Resolves: #76031
Relates: #64258
Reviewed-on: https://review.typo3.org/48479
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 2eb30c3..91741f1 100644 (file)
@@ -360,7 +360,7 @@ class PageRepository
         }
         $row = null;
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'])) {
-            foreach ($pagesInput as $origPage) {
+            foreach ($pagesInput as &$origPage) {
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $classRef) {
                     $hookObject = GeneralUtility::getUserObj($classRef);
                     if (!$hookObject instanceof PageRepositoryGetPageOverlayHookInterface) {
@@ -369,6 +369,7 @@ class PageRepository
                     $hookObject->getPageOverlay_preProcess($origPage, $lUid, $this);
                 }
             }
+            unset($origPage);
         }
         // If language UID is different from zero, do overlay:
         if ($lUid) {