[BUGFIX] Fixes required CKeditor fields in flexforms 90/53490/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 14:22:17 +0000 (16:22 +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/53490
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php

index c008267..09aa5bb 100644 (file)
@@ -182,8 +182,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 . '\'));
                         });