Hi,
Problem/Motivation
After upgrading to Drupal 10.5 with PHP 8.3, an issue occurs with formatted text fields using CKEditor 5 and the Link plugin in toolbar.
When a link is first added via the editor, everything works as expected. However, if you click on the link again and choose to edit it, the URL field is missing in the modal dialog. This makes it impossible to update the link via the user interface.
Important: If you switch to source code view, the href attribute is present and correctly set, meaning the data is intact the issue is with the rendering of the edit interface.
A JavaScript error is also thrown in the browser console:
Uncaught CKEditorError: Cannot read properties of undefined (reading '_items')
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-Cannot read properties of undefined (reading '_items')
at h._moveTargetDecoratorToAdvancedGroup (editorAdvancedLink.js?v=10.5.0:1:11611)
at C.<anonymous> (editorAdvancedLink.js?v=10.5.0:1:10104)
at C.fire (ckeditor5-dll.js?v=45.2.0:5:639290)
at C.set [as visibleView] (ckeditor5-dll.js?v=45.2.0:5:641653)
at C._showView (ckeditor5-dll.js?v=45.2.0:5:607964)
at C.add (ckeditor5-dll.js?v=45.2.0:5:604887)
at le._addFormView (link.js?v=45.2.0:5:44726)
at k.<anonymous> (link.js?v=45.2.0:5:42602)
at k.fire (ckeditor5-dll.js?v=45.2.0:5:639290)
at d.<anonymous> (ckeditor5-dll.js?v=45.2.0:5:549873)
Steps to reproduce
- Ensure Editor Advanced link is installed
- Add a Long text with summary field using CKEditor 5.
- Enable the Link plugin for the text format in use.
- Edit a piece of content, select some text, click the link icon, enter a URL, and save.
- Click the linked text again and press the edit link button
- Observe that the URL field is missing from the dialog. Switch to source code view and confirm the href value is present.
.
Proposed resolution
Expected behavior:
When editing an existing link, the URL field should appear and be prefilled with the original value.
Actual behavior:
The URL field is missing in the dialog, and a JavaScript error is thrown. The href value still exists in the source HTML.
ℹ️ I'm attaching a video capture to help better illustrate the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 10.5.0_link_overlay.jpg | 18.23 KB | bsanders44 |
| #5 | 10.4.8_link_overlay.png | 46.67 KB | bsanders44 |
| screencast-drupal-2025_06_20-11_37_06.mkv | 410.65 KB | martygraphie |
Comments
Comment #2
cilefen commentedI followed the steps to reproduce but I could not reproduce the bug.
Comment #3
longwaveDo you have any other CKEditor related contrib modules installed?
Comment #4
catchThis is probably #3522476: Compatibility fix for v45 of CKEditor5. Moving to needs more info until that's confirmed either way.
Comment #5
bsanders44 commentedI am experiencing this issue on all of my sites that I upgraded to 10.5.0 yesterday from 10.4.18. Here is a screenshot of the Link overlay on the two versions, and it is clearly different. I have confirmed that it works correctly on 10.4.18, but not on 10.5.0.
Comment #6
catch@martygraphie can you confirm whether you're using linkit module?
@bsanders44 can you confirm whether you're using linkit module?
Comment #7
bsanders44 commentedNo, not using Linkit. Just CKEditor 5.
Comment #8
catchThanks for confirming.
Comment #9
xjmComment #10
alexpottI've tried to reproduce this issue on a vanilla 10.5.0 and an update from 10.4.0 to 10.5.0 and cannot reproduce using the instructions in the issue summary. Looking at the screenshot in #5 @bsanders44 what module are you using to add the extra options to the link overlay? Drupal core does not ship with the options to set the link relationship / css stuff or open in a new window. Where is this coming from?
Comment #11
alexpottI've found the contrib module that causes this problem - it's https://www.drupal.org/project/editor_advanced_link the moment I enable I get the behaviour that's documented on this issue and in the video. Updating the steps to reproduce.
This error will also occur on 11.2.x with the module installed. I'm not sure where this bug belongs. I feel it will need fixing in https://www.drupal.org/project/editor_advanced_link in the same way that LinkIt needing fixing.
Comment #12
alexpottThere's already an issue open in the module - see #3531194: D11.2 / D10.5: Uncaught CKEditorError: Cannot read properties of undefined (reading 'viewUid')
@martygraphie and @bsanders44 can you both confirm that you have the module installed?
Comment #13
catchMoving back to needs more info for now.
Comment #14
bsanders44 commentedYes, I have Editor Advanced Link installed.
Comment #15
catchOK thanks. Closing this as a duplicate of #3531194: D11.2 / D10.5: Uncaught CKEditorError: Cannot read properties of undefined (reading 'viewUid').
Comment #16
martygraphie commentedHello,
I apologize. I didn't realize that I had the Editor Advanced Link module enabled. It does indeed appear to be a duplicate.
Thank you for your analysis and sorry for the time spent.
Have a nice day.
Comment #17
xjmCrediting reporters and maintainers who helped triage this and identify the underlying causes.