Drupal is a registered trademark of Dries Buytaert
Release: Paragraphs 8.x-1.23 Minor update available for module paragraphs (8.x-1.23). Release: AI (Artificial Intelligence) 1.4.6 Minor update available for module ai (1.4.6). Release: AI (Artificial Intelligence) 1.3.11 Minor update available for module ai (1.3.11). Release: Search and Replace Scanner 2.0.0 Major update available for module scanner (2.0.0). Release: Chosen 5.0.7 Minor update available for module chosen (5.0.7). Release: Instagram Feed Block 1.0.2 Minor update available for module instagram_feed_block (1.0.2). Release: Mercury Editor Page Templates 1.0.10 Minor update available for module mercury_editor_page_templates (1.0.10). Release: Content Packages 1.1.0 Minor update available for module content_packages (1.1.0). Module Revived: Entity Browser 8.x-2.16 Module entity_browser updated after 11 months of inactivity (8.x-2.16). Usage Milestone: Media entity Twitter Module media_entity_twitter crossed 10,000 active installs.

Suggests AGROVOC taxonomy tags for content by calling a self-hosted AgroTagger service. Drupal 11 port of the legacy Drupal 7 agrovocfield_automatic sub-module, renamed to agrovocfield for this site.

What it does

When editing content, this module can automatically suggest AGROVOC concept tags for a taxonomy reference field, based on the text in another field on the same content (e.g. the body). It only fills the field when the editor has left it empty — it never overwrites tags an editor picked or already-saved tags.

On save, if automatic indexing is enabled for a field:

  1. The module reads the just-submitted value of the configured "source" field.
  2. It calls the self-hosted AgroTagger HTTP service (POST /tag) with that text.
  3. For each AGROVOC concept returned, it looks up or creates a matching taxonomy term in the field's target vocabulary. Newly created terms get their canonical AGROVOC URI stored in a field_agrovoc_uri link field, if the vocabulary has one.
  4. It populates the field with those terms before the entity is saved.

This all happens inside an #element_validate callback, so it only runs during interactive form submission — never during programmatic saves, migrations, or content imports.

AGROVOC URI linking

If the target vocabulary has a field_agrovoc_uri link field (as the "Tags" vocabulary on this site does), the module:

  • Normalizes the legacy AIMS URI the AgroTagger service returns (http://aims.fao.org/aos/agrovoc/c_XXXX) to the canonical URL it redirects to today (https://aims.fao.org/aos/agrovoc/c_XXXX.html), avoiding a multi-hop redirect chain on every click.
  • Stores it on the term, so it renders as a normal clickable link wherever the term's own fields are displayed (e.g. the term's own page, if field_agrovoc_uri is enabled in its "Manage display" settings).

Separately, the Tagify widget's own built-in "Include info label" setting can show this URI directly inside each tag pill while editing — set the widget's "Info label content" to the token [term:field_agrovoc_uri]. This is a standard Tagify feature, not something this module adds; it just needs field_agrovoc_uri to exist and be populated, which this module handles.

Terms without this field are unaffected. For terms created beforefield_agrovoc_uri existed (or matched by name to a pre-existing term rather than auto-created), the URI isn't set automatically — but it can be backfilled after the fact using the AgroTagger service's GET /lookup?label= endpoint (a direct dictionary lookup against the same label→URI mapping used for tagging, added specifically for this). There's no UI for this yet; it's a one-time drush php:script that loads every term in a bundle with field_agrovoc_uri, skips any that already have a value, calls /lookup for the rest, and saves the normalized URI for whatever matches. Not run automatically — re-run it manually if more untagged legacy terms show up later.

Requirements

  • A running AgroTagger service reachable from this Drupal installation. See agrotagger/adr-agrotagger-selfhosted-2026-08-05.md in this repo for how that service is built and deployed (a Java service wrapping the MAUI keyphrase-extraction library, running as a K3s Deployment/Service in this cluster).

  • A taxonomy reference field using one of the two supported widgets:

    • Core's Autocomplete (Tags style) widget (entity_reference_autocomplete_tags)
    • The Tagify contrib module's widget (tagify_entity_reference_autocomplete_widget)

    These are the only widgets supported — both are "tags style" widgets (a single multi-value element per field, not one element per delta), matching what the original Drupal 7 module supported via core's taxonomy_autocomplete widget. Other entity reference widgets are silently ignored.

Configuration

Service connection: Configuration → Content authoring → AGROVOC Field (/admin/config/content/agrovocfield). Sets the AgroTagger service base URL (default http://agrotagger:8080, the in-cluster service DNS name) and the request timeout.

Per-field settings: Structure → Content types → [type] → Manage form display, then the widget settings (gear icon) for the taxonomy reference field. Below the widget's own settings you'll find:

  • Enable AGROVOC automatic indexing — on/off for this field.
  • Field to index — which other field on the same content supplies the source text.
  • Maximum number of tags to suggest — caps how many AGROVOC concepts get applied.

Known limitations

  • The AgroTagger service's bundled model (agrovoc_en) is English-only. Non-English content will produce poor or nonsensical tags — this is a model limitation, not a bug in this module.
  • Tag suggestions currently have no confidence score (score is always null) — the underlying service doesn't yet surface one from the legacy MAUI pipeline. See the AgroTagger ADR's "Consequences" section for details.
  • Requires the source field to be plain or lightly-formatted text; HTML is stripped before sending to the tagging service, but no other content extraction happens (no PDF/file support).
  • Backfilling existing terms' AGROVOC URI is a manual one-time script, not an automatic or scheduled process (see "AGROVOC URI linking" above) — it won't pick up newly unlinked terms on its own.

Activity

Tracked releases
3
Tracked since
Aug 2026
Latest release
4 hours ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
1.0.2 Stable Aug 5, 2026
1.0.x-dev Dev Aug 5, 2026
1.0.1 Stable Aug 5, 2026