CKEditor fatal if taxonomy module is disabled

Created on 17 April 2025, 9 days ago

Problem/Motivation

The tone and translate CKEditor AI plugins currently have an undefined dependency on the taxonomy module, which results in the following fatal on the Text format config form when the taxonomy module is disabled.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "taxonomy_vocabulary" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Drupal\Core\Entity\EntityTypeManager->getHandler() (Line: 192)
Drupal\Core\Entity\EntityTypeManager->getStorage() (Line: 39)
Drupal\ai_ckeditor\Plugin\AICKEditor\Tone->buildConfigurationForm() (Line: 168)
Drupal\ai_ckeditor\Plugin\CKEditor5Plugin\AiCKEditor->buildConfigurationForm() (Line: 468)
Drupal\ckeditor5\Plugin\Editor\CKEditor5->injectPluginSettingsForm() (Line: 372)
Drupal\ckeditor5\Plugin\Editor\CKEditor5->buildConfigurationForm() (Line: 177)
Drupal\editor\Hook\EditorHooks->formFilterFormatFormAlter() (Line: 459)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 838)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 249)
Drupal\autosave_form\Form\AutosaveFormBuilder->prepareForm() (Line: 280)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)

Steps to reproduce

  • Ensure the taxonomy term module is disabled.
  • Add a text format and add enable the AI CKeditor button.
  • Re-edit the text format, the fatal will appear.

Proposed resolution

While checking if the Taxonomy module is enabled before loading vocabularies does prevent the initial error, it doesn't fully resolve the issue, the plugin itself can still be enabled, leading to fatal errors during content editing. If plugins can have external dependencies, we should consider implementing a validation mechanism to determine whether the plugin should be available at all. Alternatively, we could dynamically enable or disable the plugin based on the status of the Taxonomy module.

🐛 Bug report
Status

Active

Version

1.1

Component

AI CKEditor

Created by

🇳🇱Netherlands arkener

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