Problem/Motivation

With the Entity Link Suggestions CKEditor 5 plugin enabled, editing an existing link's Displayed text and clicking Update throws a JS error and prevents editing. It appears to only happen for links whose URL is not a resolved entity suggestion, such as a relative views path (/articles), an unresolved internal path (/test), or an external URL (https://google.com). Links picked from autocomplete work fine.

Uncaught CKEditorError: unexpected-error
Original error: TypeError: Cannot read properties of undefined (reading 'attributes')
  at Differ.getChanges
  at _registerCoupledAttributesPostFixer (html-support.js)
  at _addExtraAttributesOnLinkCommandExecute (drupalEntityLinkSuggestions.js)

Steps to reproduce

  1. Enable a text format using CKEditor 5 with the Entity Link Suggestions filter/plugin (Entity links).
  2. In a body field, add a link with URL /test and some text, then save.
  3. Edit the node, edit the link, and in the popup box change the Displayed Text before touching the URL.
  4. Click Update.

Expected: the link's visible text updates.

Actual: CKEditorError: unexpected-error in the console and the text change is not applied.

Issue fork drupal-3623171

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

segovia94 created an issue.

segovia94 changed the visibility of the branch 3623171-editing-a-links-11.x to hidden.