[BUGFIX] Accept configuration for external plugins from presets in ckeditor 57/56157/2
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:21:33 +0000 (12:21 +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/56157
Tested-by: TYPO3com <no-reply@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 9fe8f2e..fc4690c 100644 (file)
@@ -172,6 +172,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;