Missing field_types and widget_types in automator_text field widget action

Created on 18 August 2025, 16 days ago

Problem/Motivation

I was trying out the new field widget action buttons in the 1.2.x branch with a long plain text field, and was unable to configure the automator_text field widget action on the node form display. After I added string_textarea to wiget_types and string_long to field_types in ai_automators/src/Plugin/FieldWidgetAction/Text.php's annotation, I was able to configure the automator on the form display.

Steps to reproduce

- Add a long plain text field to a node.
- Configure a field widget action on the field (see https://git.drupalcode.org/project/ai/-/blob/1.2.x/docs/modules/field_wi..., note that the example in the docs is for a taxonomy tags field)
- In the second step, where you configure the automator on the form display, there is no option to configure the automator for the field.

Proposed resolution

Enable the automator_text field widget action automator for long text fields:

#[FieldWidgetAction(
  id: 'automator_text',
  label: new TranslatableMarkup('Automator Text Suggestion'),
  widget_types: ['string_textfield', 'string_textarea', 'text_textfield'],
  field_types: ['string', 'string_long', 'text'],
  category: new TranslatableMarkup('AI Automators'),
)]

Remaining tasks

Before opening an MR, I was wondering if we should add all the available text and widgets to the plugin annotation?

๐Ÿ› Bug report
Status

Active

Version

1.2

Component

AI Automators

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada brunodbo

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

Merge Requests

Comments & Activities

  • Issue created by @brunodbo
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia divyansh.gupta Jaipur

    Working on it!!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia divyansh.gupta Jaipur

    I tested this and confirmed that the Automator Text Suggestion plugin does not appear for string_long / string_textarea fields until theyโ€™re added to the plugin annotation.
    After adding them, the automator works as expected.

    Before preparing an MR: should we extend support to all text-related field + widget types (e.g. text_long, text_with_summary, text_textarea_with_summary) at the same time, so coverage is complete? Or keep the MR focused only on string_long / string_textarea?

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada brunodbo

    Since it seems this is a general purpose text automator, I think it should work for all text fields/widgets. I would say let's include all of them, since otherwise the same issue will arise for other text fields/widgets as well.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia divyansh.gupta Jaipur

    Iโ€™ve updated the plugin annotation to cover all core text field types and widgets (string, string_long, text, text_long, text_with_summary and their widgets). Tested and confirmed the Automator now shows up for each of them.
    Please review!!

  • Pipeline finished with Failed
    13 days ago
    Total: 175s
    #579110
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada brunodbo

    The attribute code in the MR looks good as far as I can tell. I also manually tested the automator_text plugin on all text fields/widgets, and the automator was available for configuration in the form display settings, and worked on the node form for all of them.

    Sidenote: I did run into an issue with the text_with_summary field type. In the form display, it's possible to configure two field widget actions for such a field, but in the field's settings, you can only configure a single automator, so both field widget actions need to use the same prompt etc., which isn't desirable in all cases (especially since the summary automator needs a prompt that tells the LLM to summarize). Additionally, when I only configured the summary_textarea_with_summary automator on the field to try it out, it wasn't working for me on the node form (no text was entered in the summary field). These are probably separate issues though, we should get one of the maintainers to confirm. Leaving this as "Needs review" for now.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany marcus_johansson

    Thank you, looking good and getting merged!

Production build 0.71.5 2024