[BUGFIX] T3editor: Get default mode if none is defined for a field 85/54085/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 9 Sep 2017 20:33:42 +0000 (22:33 +0200)
committerBenjamin Kott <benjamin.kott@outlook.com>
Sat, 9 Sep 2017 20:39:04 +0000 (22:39 +0200)
If a field is rendered by t3editor but no mode was defined, the t3editor
falls back to the default mode, which is `html` by default.

Resolves: #82424
Related: #81901
Releases: master
Change-Id: I4b94e5257429219ccd72a917faa170fbc56c34ad
Reviewed-on: https://review.typo3.org/54085
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php

index 943e4dd..662b98c 100644 (file)
@@ -229,6 +229,10 @@ class T3editorElement extends AbstractFormElement
     {
         $config = $this->data['parameterArray']['fieldConf']['config'];
 
+        if (!isset($config['format'])) {
+            return ModeRegistry::getInstance()->getDefaultMode();
+        }
+
         $identifier = $config['format'];
         if (strpos($config['format'], '/') !== false) {
             $parts = explode('/', $config['format']);