CKEditor AI integration breaks when no provider is installed; Free Tier of OpenAI adds button but it doesn't appear in editor

Created on 24 May 2025, 12 days ago

Problem/Motivation

When configuring the CKEditor integration in the AI module (example in /admin/config/content/formats/manage/full_html), the following browser console error appears if no provider is installed:

The invalid form control with name='editor[settings][plugins][ai_ckeditor_ai][plugins][ai_ckeditor_spellfix][provider]' is not focusable.

This error suggests that the form expects a provider configuration even if none has been installed yet. It breaks the form experience and may confuse users.

Additionally, when installing a provider such as the OpenAI Provider, the error disappears. However, using the Free Tier of OpenAI, the AI button is added to the CKEditor toolbar, but it does not appear when editing content. There is no feedback or warning about this limitation, which may lead users to believe that the integration is broken.

Steps to reproduce

  1. Install the AI module (ai) on a Drupal 11.1.7 site with PHP 8.3.21.
  2. Go to /admin/config/content/formats/manage/full_html.
  3. Enable the CKEditor AI plugin under the "Editor" section.
  4. Save the configuration.
  5. Open the browser's developer console — the error appears if no provider is installed.
  6. Install and configure the OpenAI Provider using Free Tier credentials.
  7. Add the AI button to the CKEditor toolbar.
  8. Create or edit a content item using the configured text format — the AI button does not appear.

Proposed resolution

Improve validation and conditionally display or hide fields when no provider is available.

Provide a clear warning message if no provider is configured, explaining the impact.

Detect Free Tier limitations and inform the user that the AI button might not work or be displayed properly under such constraints.

User interface changes

Error or warning message in the CKEditor configuration UI when no provider is available.

🐛 Bug report
Status

Active

Version

1.0

Component

AI CKEditor

Created by

🇧🇷Brazil wfraga

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024