Check if Ckeditor5 exists before applying focusManager

Created on 21 June 2024, 6 months ago
Updated 11 July 2024, 5 months ago

Problem/Motivation

Insert module assume CKeditor5 is turned on and throws an error when the page load with the widgets.

  TypeError: Cannot read properties of undefined (reading 'forEach')

Steps to reproduce

* Enable the insert module
* Configure the filter to not use ckeditor5
* Add the file upload with image filed type
* Set the widget to use insert widget
* Add a content with the filter, immediate gets and error on the page.
* Possibly stops all other Javascript from running.

Proposed resolution

* Check if ckeditor5 instance exists in Javascript before applying the focus
Drupal.insert.FocusManager.addEditor(editor);

Remaining tasks

* Add patch

User interface changes

* None

API changes

* None

Data model changes

* None

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States johnle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024