Future compatibility fix for v45 of CKEditor5

Created on 2 May 2025, 15 days ago

Problem/motivation

The CKEditor v45 release creates a breaking change for the linkit decorator and additional attribute logic. When the link form is submitted, it now passes an additional displayedText argument with the submit arguments. Linkit has logic based on the length of the arguments object. Specifically, Linkit attempts to access or modify the decorators object, assuming it's the last item, which is now the displayedText argument, not the decorators object.

See the CKEditor5 LinkCommand docs for more details: https://ckeditor.com/docs/ckeditor5/latest/api/module_link_linkcommand-L...

Currently, you would need to manually update to CKEditor v45 to reproduce this, but the added bookmarks functionality is a great win, and v45 offers an improved link experience.

Steps to reproduce

  1. Update to v45 of CKEditor (in my use case, this was done by using the Premium features plugin pack > after I ad-hoc patched in v45 as an option. β†’ )
  2. Create/Edit content that uses the editor and add try to create a link
  3. Observe a console warning `Object.assign requires that input parameter not be null or undefined` which (in version 6.x) corresponds to the ` linkCommand.once('execute', (evt, args) => {...}` in `index.js::_handleExtraFormFieldSubmit`
  4. and also to `linkediting.js::_addExtraAttributesOnLinkCommandExecute`

Proposed resolution

In future releases, the affected logic should be updated to specifically reference the execute arguments link decorator object instead of using object length-derived solutions.

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
πŸ› Bug report
Status

Active

Version

6.1

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States eadamse

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