[BUGFIX] Fixes required CKeditor fields in flexforms 19/53519/2
authorArmin Vieweg <armin@v.ieweg.de>
Fri, 14 Jul 2017 20:31:48 +0000 (22:31 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 15 Jul 2017 16:19:42 +0000 (18:19 +0200)
CKeditor throwed errors in javascript, when field identifier
contained dot's. Using array syntax for CKEDITOR.instances
solved this issue.

Releases: master, 8.7
Resolves: #81390
Change-Id: I1f876de7aab1b6370aa89420600079c1439d339d
Reviewed-on: https://review.typo3.org/53519
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php

index da7cbe7..9fe8f2e 100644 (file)
@@ -186,8 +186,8 @@ class RichTextElement extends AbstractFormElement
                 $(function(){
                     CKEDITOR.replace("' . $fieldId . '", ' . json_encode($configuration) . ');
                     require([\'jquery\', \'TYPO3/CMS/Backend/FormEngine\'], function($, FormEngine) {
-                        CKEDITOR.instances.' . $fieldId . '.on(\'change\', function() {
-                            CKEDITOR.instances.' . $fieldId . '.updateElement();
+                        CKEDITOR.instances["' . $fieldId . '"].on(\'change\', function() {
+                            CKEDITOR.instances["' . $fieldId . '"].updateElement();
                             FormEngine.Validation.validate();
                             FormEngine.Validation.markFieldAsChanged($(\'#' . $fieldId . '\'));
                         });