Generate with AI prompt required

Created on 8 April 2025, 4 months ago

Problem/Motivation

When enabling the Generate With AI option for the CK Editor AI module in a text format, it shows a text box called"Completion pre prompt". This has the help text "This prompt will be prepended before the user prompt. This field may be left empty too." but when the Enabled checkbox is ticked, the textbox becomes required and it is not possible to save the form with it empty.

Remaining tasks

It is not clear whether the help text or the required status is incorrect, so we will need a maintainer to advise and then the relevant solution put in place.

🐛 Bug report
Status

Active

Version

1.1

Component

AI CKEditor

Created by

🇬🇧United Kingdom MrDaleSmith

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

Merge Requests

Comments & Activities

  • Issue created by @MrDaleSmith
  • 🇮🇳India anjaliprasannan

    I tried in a fresh installation of drupal and could not reproduce the issue.

  • 🇬🇧United Kingdom MrDaleSmith

    Your video doesn't show you clicking "enable" on the Generate with AI section of the settings: it shows you unchecking the box. To recreate, use the latest dev 1.1 release, check the "enable" box but do not enter a prompt in the text area.

  • 🇮🇳India anjaliprasannan

    @mrdalesmith Apologise, I have tried this again and I see the issue exist. Once the maintainers have a word on this, I will proceed on the fix.

  • 🇮🇳India prashant.c Dharamshala

    Since there hasn't been any activity on this for the past 5 days and we are seeking for input from the maintainers, I am unassigning @anjaliprasannan for now.

    Feel free to reassign it to yourself once the necessary inputs are available.

    Also, we might want to consider leaving the prompt field empty, as the help text suggests: "This prompt will be prepended before the user prompt. This field may be left empty too."

  • 🇮🇳India prashant.c Dharamshala
  • 🇮🇳India anjaliprasannan

    I see the same issue in summarize, translate, fix spelling, reformat html, tone prompts as well.

  • 🇳🇿New Zealand danielveza Brisbane, AU

    Confirming this is an issue. Can be replicated with the latest version of the AI module. The help text states the field can be left empty, but the Completion plugin is marking the field as required if it's enabled. The text format can't be saved if the field is empty.

  • First commit to issue fork.
  • Pipeline finished with Success
    19 days ago
    Total: 243s
    #547578
  • 🇮🇳India sijumpk

    It appears that the 'required' condition based on the 'enabled' state was introduced in issue #3512278 🐛 Spell Fix plugin has provider as required field Active . In the ajaxGenerate function, the prompt is generated conditionally based on the presence of the 'Completion pre prompt' value. However, even if this field is empty, the functionality remains unaffected. Therefore, removing the 'required' condition from the code. Pls review and confirm.

  • 🇺🇸United States johnpicozzi Providence, RI

    I ran into this problem and originally thought it was an issue with all the AI CKEditor options. I'm specifically using Summarize, Spell Check, Tone, and Generate with AI. As noted above I was trying to update another CKEditor setting and my edit screen wouldn't save (no error message), I looked at my AI CKEditor settings and noticed all my prompts had been removed.

    When disabling and enabling the AI CKEditor Options the prompts didn't re-populate, I had to uninstall and re-install the AI CKEditor Integration module. Once I did that I had prompts entered for Summarize, Tone, and Spell Check. However, Generate with AI still didn't have a prompt and the field was required on checking enable. I applied a patch based on the MR above and I was able to enable the Generate with AI option and the prompt wasn't required.

    I think this patch solves the immediate problem of the Generate with AI prompt field being required and would vote to move this to RTBC.

    However, I think another issue should be created to provide the default prompt text for those other options if the option is enabled and the prompt field is empty. Would be interested to hear others thoughts on this, before the feature request is created.

  • 🇩🇪Germany marcus_johansson

    Thanks all, looks good - getting merged and backported to 1.1.x

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Remove outdated backport tag

Production build 0.71.5 2024