[BUGFIX] Respect cached page config 32/41132/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 27 Apr 2015 13:17:27 +0000 (15:17 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Wed, 15 Jul 2015 12:19:11 +0000 (14:19 +0200)
On a cached page, initialise the page config only if it does not exist
yet. Merge the cached config with the template config to get the same
array as on a uncached page.

Releases: master, 6.2
Resolves: #66605
Change-Id: Idee4682cbfe5a8fb5f9522fc2f09e1c9bdb81396
Reviewed-on: http://review.typo3.org/41132
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index fe73286..173f0ce 100644 (file)
@@ -17,6 +17,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\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Frontend\Page\PageRepository;
@@ -2267,7 +2268,7 @@ class TypoScriptFrontendController {
                                $realGet = array();
                        }
                        // Merge new values on top:
-                       \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($realGet, $GET_VARS);
+                       ArrayUtility::mergeRecursiveWithOverrule($realGet, $GET_VARS);
                        // Write values back to $_GET:
                        GeneralUtility::_GETset($realGet);
                        // Setting these specifically (like in the init-function):
@@ -2593,14 +2594,17 @@ class TypoScriptFrontendController {
                                                throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message . ' ' . $explanation, 1294587217);
                                        }
                                } else {
-                                       $this->config['config'] = array();
+                                       if (!isset($this->config['config'])) {
+                                               $this->config['config'] = array();
+                                       }
                                        // Filling the config-array, first with the main "config." part
                                        if (is_array($this->tmpl->setup['config.'])) {
+                                               ArrayUtility::mergeRecursiveWithOverrule($this->tmpl->setup['config.'], $this->config['config']);
                                                $this->config['config'] = $this->tmpl->setup['config.'];
                                        }
                                        // override it with the page/type-specific "config."
                                        if (is_array($this->pSetup['config.'])) {
-                                               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->config['config'], $this->pSetup['config.']);
+                                               ArrayUtility::mergeRecursiveWithOverrule($this->config['config'], $this->pSetup['config.']);
                                        }
                                        if ($this->config['config']['typolinkEnableLinksAcrossDomains']) {
                                                $this->config['config']['typolinkCheckRootline'] = TRUE;
@@ -2649,7 +2653,7 @@ class TypoScriptFrontendController {
                // Merge GET with defaultGetVars
                if (!empty($this->config['config']['defaultGetVars.'])) {
                        $modifiedGetVars = GeneralUtility::removeDotsFromTS($this->config['config']['defaultGetVars.']);
-                       \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, GeneralUtility::_GET());
+                       ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, GeneralUtility::_GET());
                        GeneralUtility::_GETset($modifiedGetVars);
                }
                // Hook for postProcessing the configuration array
@@ -4837,7 +4841,7 @@ if (version == "n3") {
                        if ($this->lang !== 'default' && isset($tempLL[$language])) {
                                // Merge current language labels onto labels from previous language
                                // This way we have a label with fall back applied
-                               \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($localLanguage[$this->lang], $tempLL[$language], TRUE, FALSE);
+                               ArrayUtility::mergeRecursiveWithOverrule($localLanguage[$this->lang], $tempLL[$language], TRUE, FALSE);
                        }
                }