From d580d6c81ef327e865b8be46a89855d9ac577b05 Mon Sep 17 00:00:00 2001
From: Andreas Fernandez <a.fernandez@scripting-base.de>
Date: Mon, 27 Apr 2015 15:17:27 +0200
Subject: [PATCH] [BUGFIX] Respect cached page config

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/38958
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
---
 .../Classes/Controller/TypoScriptFrontendController.php      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index eb4e65e46eff..2c0fe6b41928 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -2493,9 +2493,12 @@ class TypoScriptFrontendController {
 						throw new 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."
-- 
GitLab