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

  1. Add a fromID of a form with a WYSIWYG/CKEDITOR field to /admin/config/content/autosaveformsid
  2. Go to the page where the form is shown
  3. 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.

CommentFileSizeAuthor
fix-ckeditor-undefined.patch1.1 KBlaarrrx

Comments

laarrrx created an issue. See original summary.

bramdriesen’s picture

Status: Active » Needs review