CKEditor fatal if taxonomy module is disabled
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3519699. -->
Reported by: [arkener](https://www.drupal.org/user/2284182)
Related to !562
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The <code>tone</code> and <code>translate</code> 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.</p>
<pre>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).<br><br>Drupal\Core\Entity\EntityTypeManager->getHandler() (Line: 192)<br>Drupal\Core\Entity\EntityTypeManager->getStorage() (Line: 39)<br>Drupal\ai_ckeditor\Plugin\AICKEditor\Tone->buildConfigurationForm() (Line: 168)<br>Drupal\ai_ckeditor\Plugin\CKEditor5Plugin\AiCKEditor->buildConfigurationForm() (Line: 468)<br>Drupal\ckeditor5\Plugin\Editor\CKEditor5->injectPluginSettingsForm() (Line: 372)<br>Drupal\ckeditor5\Plugin\Editor\CKEditor5->buildConfigurationForm() (Line: 177)<br>Drupal\editor\Hook\EditorHooks->formFilterFormatFormAlter() (Line: 459)<br>Drupal\Core\Extension\ModuleHandler->alter() (Line: 838)<br>Drupal\Core\Form\FormBuilder->prepareForm() (Line: 249)<br>Drupal\autosave_form\Form\AutosaveFormBuilder->prepareForm() (Line: 280)<br>Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)</pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ul>
<li>Ensure the taxonomy term module is disabled.</li>
<li>Add a text format and add enable the AI CKeditor button.</li>
<li>Re-edit the text format, the fatal will appear.</li>
</ul>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>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.</p>
> Related issue: [Issue #3515453](https://www.drupal.org/node/3515453)
issue