In CKEditor 5 v45.2.2 (bundled with Drupal 10.5.8), the `icons.pencil` and `icons.cog` exports were removed from `ckeditor5/src/core`. The entity_embed module's toolbar.js imports these icons, causing a JavaScript error that prevents the widget toolbar from rendering. The Edit and Settings buttons don't appear when clicking an embedded entity.
The fix replaces the icon imports with inline SVG strings that match the original CKEditor 5 pencil and cog icons, restoring toolbar functionality without depending on the removed exports.
Steps to reproduce:
1. Install Drupal 10.5.8+ (which bundles CKEditor 5 v45.2.2)
2. Enable entity_embed module
3. Add an entity embed to content using CKEditor 5
4. Click on the embedded entity
5. Observe that the widget toolbar does not appear (Edit/Settings buttons missing)
6. Check browser console for JS error about missing icon exports
Expected: Widget toolbar appears with Edit and Settings buttons.
Actual: Widget toolbar does not render
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3575503-mr64.patch | 35.91 KB | richardcapricorn |
Issue fork entity_embed-3575503
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
Comment #3
caspervoogt commentedI tested MR 64 and it worked on my end.
Comment #4
caspervoogt commentedComment #5
dave reidComment #6
justcaldwellI can confirm the issue. The patch does restore icons, but the bundled svgs don't look like the standard ckeditor icons (at least for us). See below:
Comment #7
smustgrave commentedNot in front of my computer I can commit code from but if you use
import { IconPencil, IconCog } from '@ckeditor/ckeditor5-icons';
it fixes the problem
Comment #8
dave reidYup, that's what I was going to do since that's how other modules have fixed it, and bump the minimum core version requirement to 10.5.
Comment #9
smustgrave commentedWould also see https://www.drupal.org/project/entity_embed/issues/3531672
Comment #10
dave reidYup, I'm working to combine the two and solve together.
Comment #11
smustgrave commentedAwesome thank you!
Comment #12
richardcapricorn commentedOutdated — superseded by !69. This patch only fixed icons.pencil / icons.cog and missed the CKEditor 5 v43 LinkUI._addActionsView() → _addToolbarView() rename, which breaks the link-edit flow on
already-linked embeds in CKEditor 5 v47. Please use !69 instead.
Comment #14
richardcapricorn commentedOpened !69 — a clean, source-based fix that supersedes !64 and my outdated patch in #12.
What it changes:
- toolbar.js: replaces icons.pencil / icons.cog with inlined SVG constants (removed from CKEditor 5 core in v45)
- linkui.js: renames LinkUI._addActionsView() → _addToolbarView() (renamed in CKEditor 5 v43)
- js/build/drupalentity.js: rebuilt from the updated sources via `npm run build`
Why the rename matters: without it, editing the link on an already-linked entity embed throws `r._addActionsView is not a function` in CKEditor 5 v45+. !64 only fixed the icons and missed this.
Verified end-to-end against Drupal core's bundled CKEditor 5 v47.6.0.
Note on the red CI: every failing test errors with `UnmetDependenciesException: field.field.node.article.body (field.storage.node.body)` during entity_embed_test module install. The same failure pattern appears
on !64 and !65, so it pre-exists 8.x-1.x and is unrelated to the JS-only changes in !69. It looks like a test-fixture incompatibility with Drupal core ≥ 11.3, where the body field is no longer auto-created in
the testing setup. Worth tracking in a separate issue.