[BUGFIX] Accept configuration for external plugins from presets in ckeditor 57/52857/7
authorMarcus Schwemer <ms@schwemer.de>
Thu, 18 May 2017 20:57:25 +0000 (22:57 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 15 Mar 2018 11:01:30 +0000 (12:01 +0100)
Currently the default configuration of an external
plugin is always used for the configuration. This patch takes care
of a proper merging of the configuration.

The configuration of the extension is taken as default. If a
custom configuration in a preset is available, both configurations
will be merged.

Resolves: #81263
Releases: master,8.7
Change-Id: I4fc7c4f6f6ab40fe06e495e3ff98e067427c7d03
Reviewed-on: https://review.typo3.org/52857
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php

index 59f1d9a..708baa9 100644 (file)
@@ -168,6 +168,9 @@ class RichTextElement extends AbstractFormElement
 
         $externalPlugins = '';
         foreach ($this->getExtraPlugins() as $pluginName => $config) {
+            if (!empty($config['config']) && !empty($configuration[$pluginName])) {
+                $config['config'] = array_replace_recursive($config['config'], $configuration[$pluginName]);
+            }
             $configuration[$pluginName] = $config['config'];
             $configuration['extraPlugins'] .= ',' . $pluginName;