Currently, the Tagify module submits a JSON string containing full entity data (labels, values, etc.). When used in a GET form (like a standard Search View), this results in extremely long and unreadable URLs (e.g., ?tags=[{"value":"9","label":"Drupal",...}]), which breaks "Clean URL" expectations and can hit URL length limits.

This patch implements a robust strategy to support standard comma-separated ID filtering (e.g., ?tags=9,10):

  1. Javascript Mirror: It automatically creates a hidden input field that mirrors the Tagify selection as a simple CSV string of IDs. The original JSON input is stripped of its name attribute so it is not submitted.
  2. Race Condition Protection: It uses "Capture-Phase" event listening to ensure the hidden mirror is updated before BEF or other AJAX scripts serialize the form data.
  3. PHP Handlers: It updates EntityAutocompleteTagify and the BEF Tagify plugin to gracefully handle both JSON (for backwards compatibility) and the new clean CSV format during validation and processing.

Issue fork tagify-3580987

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

heyyo created an issue. See original summary.

heyyo’s picture

Status: Active » Needs review

Made with AI, but works great for me