[BUGFIX] Fix broken require / validation handling for ckeditor 34/52134/3
authorFrank Naegler <frank.naegler@typo3.org>
Thu, 23 Mar 2017 13:16:57 +0000 (14:16 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 23 Mar 2017 15:31:16 +0000 (16:31 +0100)
This patch fix the broken require / validation handling for ckeditor.
To revalidate the form, the field is now updated on change and the
validation will be started.

Reolves: #80415
Releases: master
Change-Id: I731ffeb6a7fa217aa2c07004cdb424ea2a20f932
Reviewed-on: https://review.typo3.org/52134
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php

index d5770f8..f485c41 100644 (file)
@@ -184,6 +184,12 @@ class RichTextElement extends AbstractFormElement
         return 'function(CKEDITOR) {
                 ' . $externalPlugins . '
                 CKEDITOR.replace("' . $fieldId . '", ' . json_encode($configuration) . ');
+                require([\'TYPO3/CMS/Backend/FormEngine\'], function(FormEngine) {
+                    CKEDITOR.instances.' . $fieldId . '.on(\'change\', function() {
+                        CKEDITOR.instances.' . $fieldId . '.updateElement();
+                        FormEngine.Validation.validate();
+                    });
+                });
         }';
     }