Problem/Motivation
When you auto save a form without a WYSIWYG/CKEDITOR field you get a JS error in the console in Chrome that says the CKEDITOR is not defined.
Uncaught ReferenceError: CKEDITOR is not defined
at Object.attach (auto-save-form.js?v=1.x:13:30)
at drupal.js?v=9.3.12:27:24
at Array.forEach (<anonymous>)
at Object.Drupal.attachBehaviors (drupal.js?v=9.3.12:24:34)
at drupal.init.js?v=9.3.12:29:12
at HTMLDocument.listener (drupal.init.js?v=9.3.12:17:7)Steps to reproduce
- Add a fromID of a form with a WYSIWYG/CKEDITOR field to /admin/config/content/autosaveformsid
- Go to the page where the form is shown
- Open your Chrome DevTools and see the JS error in the Console
Proposed resolution
Add an if statement around the CKEDITOR.instances for loop to check if CKEDITOR is defined.
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
I added the proposed resolution in the attached patch.
| Comment | File | Size | Author |
|---|---|---|---|
| fix-ckeditor-undefined.patch | 1.1 KB | laarrrx |
Comments
Comment #2
bramdriesen