feat: #3536912 Suggest Tags automator should work with Tagify

Description

This MR adds:

  1. TagifyTaxonomy (new) — for tagify_entity_reference_autocomplete_widget and tagify_user_list_entity_reference_autocomplete_widget. setFormInput() writes the [['target_id' => id], …] shape and lets EntityAutocompleteTagify::valueCallback() serialise it. That keeps "view label" access checks, translation context, info-label token replacement, hierarchical parent_name and user avatars inside the tagify module instead of duplicating its JSON contract here. No tagify class is referenced from the plugin, so tagify stays optional
    1. ClassificationOptionsSelect — tagify_select_widget added to widget_types. Tagify Select renders a plain multi-value select, so the existing widgetHandlesMultipleValues() flat-ID branch already produces the right shape. Reusing this plugin ID rather than adding a second plugin also means a configured action survives switching between the select-style widgets.
  2. Config schema — field_widget_action_automator_base plus entries for the two plugin IDs, so settings.automator_id is typed.

Testing instructions

Setup: ddev composer require drupal/tagify:^2.0 and ddev drush en field_widget_actions tagify -y, with a working default chat provider.

  1. Add an unlimited-cardinality taxonomy term reference field (e.g. field_tags) to Article, targeting the Tags vocabulary, with "Create referenced entities if they don't already exist" checked.
  2. On the same field, enable the AI Automator: type "LLM: Taxonomy", Base Mode, Automator Base Field "Body", and under Advanced Settings set Automator Worker / Process to "Field Widget Actions".
  3. Go to /admin/structure/types/manage/article/form-display, set the field's widget to Tagify, and click the gear.
  4. Expand Field Widget Actions (collapsed by default). In "Add New Action" choose "Automator Taxonomy" and click "Add action". Tick "Show button on edit form", expand "Enable an Automator", pick your automator, set Button label to "Suggest tags". Click Update, then Save at the bottom of the page.
  5. Go to /node/add/article, enter a title and a few paragraphs of Body, then click "Suggest tags". The suggested terms appear as Tagify chips, each with a working x to drop it.
  6. Save the node and confirm the remaining terms are attached. Reopen the edit form and confirm the chips round-trip.
  7. Repeat steps 3-6 with the Tagify Select widget; there the action is listed as "Classification (Options/Chosen Select)".
  8. Regression check: switch the widget back to "Autocomplete (Tags style)" and confirm that action still fills the field as before.

Checklist

  • I have linked the related issue in the MR title or description
  • I have performed a self-review of my own code
  • I have added or updated tests, or explained in the description why this change is not covered by tests
  • I have updated documentation for any new or changed functionality
  • I have written testing instructions and verified them locally
  • I have noted any required post-merge steps (config imports, cache rebuilds, manual changes)
  • This MR contains no breaking API or hook changes, or they are explicitly documented in the description

AI Compliance

Note

Check the one that best describes your usage, or leave all unchecked if AI was not significantly used.

  • AI Assisted Code
    Mainly written by a human; AI used for autocomplete or partial generation under full human supervision.

  • AI Generated Code
    Mainly generated by AI, reviewed and approved by a human before this MR was created.

  • Vibe Coded
    Generated by AI and only functionally reviewed before this MR was created.

Closes #3536912

Merge request reports

Loading