Problem/Motivation
The Editor module tracks when an editor has modified a field, and reverts the value of a field when its editor has not made any changes. When editing HTML source in CKEditor, the "change" event is not fired and the field is not flagged as having been changed, which will cause the field to be reverted in some conditions.
Steps to reproduce
- Edit a node with a body field that uses CKEditor.
- Press "Source" in the CKEditor instance, without making any other changes.
- Change the source to anything you like.
- Use the code inspector to inspect the accompanying, hidden textarea (its name will be "body[0][value]").
- The "data-editor-value-is-changed" attribute should be "true", but is not.
- Click "Source" again.
- Inspect the textarea again. The "data-editor-value-is-changed" is now correctly set to "true".
Proposed resolution
Using a solution similar to what is outlined at https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_editor.html#even..., add code to behave similarly to the change event handler.
Remaining tasks
Develop and test.
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Release notes snippet
n/a