"Uncaught CKEditorError: e is null" when using caption and alternative text buttons on embedded image

Created on 7 May 2024, about 2 months ago
Updated 20 May 2024, about 1 month ago

Problem/Motivation

When embedding an image with the media library and the CKEditor5, the "Toggle caption on" and "Override media image alternative text" do not work well together.
When I click the button for the caption first and then the one for the alternative text I get the following error:

Uncaught CKEditorError: e is null
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-e is null
    viewToDom https://core.ddev.site/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=40.2.0:5
    v https://core.ddev.site/sites/default/files/js/js_2mrOWHSZx9O6jX7tO-KuQgnqayYo53nHym5P-BpEM2k.js?scope=footer&delta=2&language=en&theme=claro&include=eJyNU1FuwjAMvVBov3aATYKvSTsCcoNpLZw4Sxy0cfoltAEB0tSvPr_3bLmObcUr_mgG7g8xB-DO3pgNkz8lYyVi7yU6YLqgsQxR-pFlKI6kv8U0zp6lAFilM16TF7OXA26OpYKpqPkqfki0wgwhPZKQVay4wKhoAujUhIqNQ5_3mRq3hA8FkoJiMkdixdjIOTL2hAdSiW89lZ-Oviitl6as8XTowgSJ0irzpI63fiSPq-zkYFzndAXAO9Po5wHclTrEOn_QZ2VgsafvLIrPyvx-z1x6qRAgKe6iuK_jkexLmSQ5WtyWqO7JzLZXmKOudM0yrvpFW3bmo7a8yq0w8EtDk0S6lB0H_rw-waMa0ckZd_Os6h20Xis2qSSrzTeyxUZFeIDYL1-T033XKu6onFU9pX-ureU-1eowWQj4fnDkzUDjPlDAvoE_eoNwQA:54
ckeditor5-dll.js:5:597480

Nothing will happen for the user but the error will show up in the developer console each time that "Override media image alternative text" gets clicked. When you click "Toggle caption off" and click "Override media image alternative text" you will be able to set the alternative text.
This does not happen when I use the "Update image from computer" button and click the caption and alternative text buttons of that image.

Steps to reproduce

The following modules are needed:

  • CKEditor5
  • Text Editor
  • Field UI
  • Media
  • Image
  • Views
  • Media Library
  1. Install the modules mentioned above.
  2. Create a new text format that uses the CKEditor5 and add "Drupal Media" button, the "Caption images" filter and "Embed Media" filter to it.
  3. Create a new content type or add a field of type "Text (formatted, long, with summary)" to an existing content type.
  4. Create a new media type with the media source "image" or use an exisiting one.
  5. Click "+ Add media" under "/admin/content/media" and upload an image. (Use the media type just created)
  6. Click "+ Add content" under "/admin/content". (Use the content type just created)
  7. Click the "Insert media" button of the Editor and select an image.
  8. Click button "Toggle caption on".
  9. Click button "Override media image alternative text".
  10. Open the developer console. The error will be there.

🐛 Bug report
Status

Active

Version

10.2

Component
Media 

Last updated about 14 hours ago

Created by

🇩🇪Germany lmoeni

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

Comments & Activities

Production build 0.69.0 2024