Error on views with BEF and Tagify

Created on 5 August 2025, 28 days ago

Problem/Motivation

We're replacing Select2 with Tagify in our project.
We have a filter in a view that searches taxonomy terms with BEF and the Select2 widget, and switching to Tagify displays a Drupal Ajax error. The view preview works, and the filter is still accessible.
As soon as we save the changes, the preview no longer displays anything, and when we go to the view, we get this error:
Warning: Undefined array key "#target_type" in www/modules/contrib/tagify/src/Plugin/better_exposed_filters/filter/Tagify.php on line 63

Steps to reproduce

Add a filter in a views to search in a taxonomy with Select2 widget and switch to Tagify

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇫🇷France Jérôme Dehorter Lille

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

Comments & Activities

  • Issue created by @Jérôme Dehorter
  • 🇫🇷France Jérôme Dehorter Lille

    We can see in the attached screenshot that the data used in the code does not match the actual data when displaying the views.

  • 🇧🇪Belgium herved

    I encountered this issue as well, it looks like the tagify BEF widget expects the exposed filter to be of type "Autocomplete" and is incompatible with "Dropdown" at the moment.

  • 🇫🇷France Jérôme Dehorter Lille

    Hello,
    I just tested the field in its autocomplete version and Tagify via BEF, and everything works fine. I'm even wondering if it's necessary to create code for the drop-down list version.
    Perhaps we just need to update the documentation to explain that the autocomplete version handles the multi-selection and that the list selection is irrelevant.

Production build 0.71.5 2024