"Exclude textfield" from auto-submit logic ignored since 6.0.4 when using autocomplete

Created on 22 April 2024, 7 months ago
Updated 14 June 2024, 5 months ago

I have a View showing Search API results and is using BEF on an exposed "Fulltext search" filter. The filter also has search_api_autocomplete enabled on it.

I have the BEF options set to "Enable auto-submit" and also "Exclude Textfield" to prevent auto-submit from triggering on the fulltext search field. This has always worked fine previously but, having just updated from 6.0.3 to 6.0.5, the auto-submit is now triggering on the field when it shouldn't. If I return back to 6.0.3, it works as before and doesn't auto-submit on the field.

For extra testing, I then updated to 6.0.4 and the problem started again so looks like the issue was introduced in 6.0.4.

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom ttesteve

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

Merge Requests

Comments & Activities

  • Issue created by @ttesteve
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Would try out 6.0.5 as there a fatal bug in 6.0.4 that messed with the view configuration

  • πŸ‡¬πŸ‡§United Kingdom ttesteve

    Thanks smustgrave but getting the same problem in both 6.0.4 and 6.0.5 as mentioned in the original post.

  • πŸ‡³πŸ‡±Netherlands ifrik

    I can confirm the same problem: For 6.0.4 and 6.0.5, excluding the text field from auto submit does not work.

    The db update when upgrading from 6.0.3 to 6.0.4 also changed the existing BEF configuration in the view where it was used, incl. disabling the autosubmit and removing the default text for the text field - rather then just adding the config for collapsing, which I assume it was supposed to do.

    See this config change as an example:

              bef:
    -            general:
    -              autosubmit: true
    -              autosubmit_exclude_textfield: true
    -              autosubmit_hide: true
    -              input_required: false
    -              allow_secondary: false
    -              secondary_label: 'Advanced options'
    -              text_input_required: 'Select any filter and click on Apply to see results'
    -              text_input_required_format: basic_html
    -            sort:
    -              plugin_id: default
    -              advanced:
    -                combine: false
    -                combine_rewrite: ''
    -                reset: false
    -                reset_label: ''
    -                collapsible: false
    -                collapsible_label: 'Sort options'
    -                is_secondary: false
                 filter:
    -              search_api_fulltext:
    -                plugin_id: default
    +              filter:
                     advanced:
    -                  sort_options: false
    -                  placeholder_text: 'Search in the text'
    -                  rewrite:
    -                    filter_rewrite_values: ''
    -                  collapsible: false
    -                  is_secondary: false
    +                  collapsible_disable_automatic_open: false
           access:
             type: none
    
  • This seems to be the cause of the issue: https://git.drupalcode.org/project/better_exposed_filters/-/commit/7fbd2...

    Without the reference, the attribute to exclude it from autosubmit is not set in the form anymore.

    But I'm not sure why this change was introduced and if simply reverting would cause other problems.

  • πŸ‡©πŸ‡ͺGermany seanpb

    As moritzkunz saw, reverting that change does fix this issue. Additionally, the change made in that diff appears to be equivalent to removing that code block as modifying the variable passed by reference is the only thing it does.

    Reverting it doesn't appear to change the behavior around expanded/collapsed facets mentioned in the referenced issue, though it's "broken" in the same way as described there with or without this patch ( https://www.drupal.org/project/better_exposed_filters/issues/3266858 ✨ Allow not automatically opening collapsed filter Needs review ).

  • πŸ‡©πŸ‡ͺGermany seanpb
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Appears to be the related issue

  • Merge request !71Fix regression β†’ (Merged) created by smustgrave
  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Tests were there just wasn't pulling a fresh copy of Html to review

  • Status changed to Fixed 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since this is a regression and trying to plan a release today or tomorrow going to merge. can always reopen

  • πŸ‡³πŸ‡±Netherlands ifrik

    Thanks, that works for me, so I would RTBC it, if it hadn't been already set to Fixed.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡ͺπŸ‡ΈSpain pcambra Asturies

    Could we have a release with this? pretty please

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Will try and plan one early next week. Waiting to see if anyone reviews the jquery removal tickets.

  • πŸ‡ΊπŸ‡ΈUnited States joegraduate Arizona, USA

    Was this actually merged? I don't see it in the 6.0.x/7.0.x branches...

  • πŸ‡¬πŸ‡§United Kingdom malcomio

    Here's the commit in the 6.0.x branch - this seems to be included in release 6.0.6, although the commit message doesn't mention this issue.

Production build 0.71.5 2024