From 9ee2f3ce70000189aed8c15371b1a9b9d4255b17 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Fri, 9 Jun 2017 23:36:13 +0200
Subject: [PATCH] [BUGFIX] Allow RTE yml presets in LocalConfiguration

ext:rte_ckeditor declares the default config yml preset pointers
of TYPO3_CONF_VARS['RTE'] in its ext_localconf.php file.
This file is loaded after LocalConfiguration.php.
The patch wraps the declarations in guards to ensure any
previously set pointers are not blindly reset.

Change-Id: Ic945d988f436aab7453b7f7fba8694bbf3580b1d
Resolves: #81537
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53181
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 typo3/sysext/rte_ckeditor/ext_localconf.php | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/rte_ckeditor/ext_localconf.php b/typo3/sysext/rte_ckeditor/ext_localconf.php
index 324b8b04f724..0fde35253a1b 100644
--- a/typo3/sysext/rte_ckeditor/ext_localconf.php
+++ b/typo3/sysext/rte_ckeditor/ext_localconf.php
@@ -24,6 +24,12 @@ if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) {
 }
 
 // Register the presets
-$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:rte_ckeditor/Configuration/RTE/Default.yaml';
-$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['minimal'] = 'EXT:rte_ckeditor/Configuration/RTE/Minimal.yaml';
-$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['full'] = 'EXT:rte_ckeditor/Configuration/RTE/Full.yaml';
+if (empty($GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'])) {
+    $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'EXT:rte_ckeditor/Configuration/RTE/Default.yaml';
+}
+if (empty($GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['minimal'])) {
+    $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['minimal'] = 'EXT:rte_ckeditor/Configuration/RTE/Minimal.yaml';
+}
+if (empty($GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['full'])) {
+    $GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['full'] = 'EXT:rte_ckeditor/Configuration/RTE/Full.yaml';
+}
-- 
GitLab