Uninstalling ai_editoria11y can leave stale plugin config in editor.editor.* entities (notably full_html).
After uninstall, CKEditor5 still reads old AI-related toolbar/plugin config and can fail to initialize.

Problem/Motivation

What we observed
- Initial failure was a WSOD-style exception:
- PluginNotFoundException: The "ai_editoria11y_fix" plugin does not exist
- After partial cleanup, editing still failed in browser console:
- CKEditorError: plugincollection-plugin-not-found {"plugin":null}
- Editoria11y JS then also threw follow-up runtime errors because editor/init flow was already broken.

Steps to reproduce

Reproduction (high level)
1. Enable editoria11y, ai, ai_ckeditor, ai_editoria11y.
2. Configure full_html with AI CKEditor integration and AI toolbar buttons.
3. Uninstall ai_editoria11y.
4. Open a node edit form using CKEditor5 (full_html).
5. Observe backend exception and/or frontend CKEditor plugin init errors.
Stale active config remains in editor.editor.full_html:
- settings.plugins.ai_ckeditor_ai.plugins.ai_editoria11y_fix
- potentially related toolbar/plugin references (aickeditor, ai_balloon_menu, ai_ckeditor_ai) depending on module state/version mix.
What we had to do manually
- Remove stale keys from editor config entities.
- Rebuild caches.
- In our case, also remove AI toolbar/plugin refs from full_html to restore CKEditor boot.

Proposed resolution

Add robust uninstall cleanup in ai_editoria11y_uninstall() (and/or update hook for existing installs) to:
- Iterate all editor config entities.
- Remove settings.plugins.ai_ckeditor_ai.plugins.ai_editoria11y_fix when present.
- Optionally validate/remove orphaned toolbar/plugin references that no longer resolve.
- Save updated editor configs.
- Clear relevant caches.
Nice-to-have hardening
In ai_ckeditor/CKEditor integration path, gracefully ignore unknown configured plugin IDs instead of hard-failing editor init.

Acceptance Criteria

- After uninstalling ai_editoria11y, no editor.editor.* config references ai_editoria11y_fix.
- No PluginNotFoundException on admin/content edit pages.
- No plugincollection-plugin-not-found in browser console.
- CKEditor loads normally with remaining enabled modules.
If you want, I can also convert this into a shorter “Problem/Motivation + Steps + Proposed resolution” format matching d.org issue queue style exactly.

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

nikro created an issue. See original summary.

nikro’s picture

Do Note - it might be a false positive, maybe not 100% false positive, at least the 2nd part (console errors) - the actual root-cause was Drupal Core version + AI version + other dependencies (making a blanket upgrade solved the console errors).

joevagyok made their first commit to this issue’s fork.

joevagyok’s picture

Status: Active » Needs review
nikro’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good, I think I did like 3 installs/uninstalls test, configs do get wiped clean and reinstalled - all good, I see no issues.

joevagyok’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.