[BUGFIX] rte_ckeditor triggers has-change on change 47/53247/2
authorRalf Hettinger <ralf.hettinger@brain-appeal.com>
Mon, 29 May 2017 20:38:43 +0000 (22:38 +0200)
committerBenni Mack <benni@typo3.org>
Sat, 17 Jun 2017 21:09:00 +0000 (23:09 +0200)
CKEditor fields now triggers FormEngine.Validation.markFieldAsChanged
therefore a warning of unsaved changes on closing the form is raised
based on changes within these CKEditor fields.

Resolves: #68955
Releases: master, 8.7
Change-Id: I0da98c2204b20b0f6cd27a53b66f2df3d369a145
Reviewed-on: https://review.typo3.org/53247
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php

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