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):
- 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.
- 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.
- 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.
Comments
Comment #3
heyyo commentedMade with AI, but works great for me
Comment #4
gxleano commentedHey @heyyo
Thanks for the contribution, but we are already handling this on the next issue https://www.drupal.org/project/tagify/issues/3587546