Reset button, now using ajax, does not reset exposed form values when form is in a block.

Created on 23 May 2024, 9 months ago

Steps to reproduce

  1. Create a view with filter criteria, expose at least one filter to visitors
  2. Set "Exposed form in block" to "yes"
  3. Add view block and exposed form block to node
  4. Change at least one filter in the view
  5. Click "reset"

It should be noted that the data in the view block itself DOES reset, but the exposed form does not.

πŸ› Bug report
Status

Active

Version

6.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joakland

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

Comments & Activities

  • Issue created by @joakland
  • πŸ‡ΊπŸ‡ΈUnited States ezra

    Seconding this. I'll add that I thought turning ajax off would be a solution, but it not fix the issue.

  • πŸ‡ΊπŸ‡ΈUnited States cajewell Madison, WI

    I also ran into this issue. I have the same situation, with all five steps identical to the steps joakland listed above. The data in the view block does reset, but the check boxes or default fields on the exposed form remain checked after clicking reset. I tested this in versions 6.0.6 and 7.0.0-beta1, and both had this result. For troubleshooting, I set up a dev site and reverted back to BEF versions 6.0.3, 6.0.4, and 6.0.5. All of these versions worked as expected, with the results reset and the checkboxes cleared. So the issue started at version 6.0.6.

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

    Can confirm this issue but don't have a fix.

  • πŸ‡ͺπŸ‡ΈSpain idiaz.roncero Madrid

    Please see this comment πŸ› Reset button does not use AJAX Needs work for a quick workaround that just re-enables the Drupal core behavior - to avoid AJAX on Clear Filter buttons.

    With facets 3.x we are facing the exact opposite as cajewell said: exposed form in a block is reset when using clear filters; but view content area results are not - they keep the old filters applied.

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

    Goal of contrib is to be able to do things core cannot. Agree this is a bug but can’t just rip it out.

    Temporary solution that would be accepted is to add a setting to disable this feature.

    Will need an update hook that defaults to true so existing sites aren’t broken.

    May also be a bug with the views module itself but haven’t dug through the issue queue.

  • πŸ‡ΊπŸ‡ΈUnited States AaronBauman Philadelphia

    The suggestion in #6 does not fix the issue for me.

    Reset button still causes a redirect to the attached page display's URL, rather than reloading the current URL.

    Not sure if straight duplicate, but seems like this is a core issue also.
    πŸ› Viewsform has incorrect form submit url if loaded through ajax Needs work

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    fwiw the "reset all" link doesn't even show for me, which might be a separate bug.

  • πŸ‡ΊπŸ‡ΈUnited States anilu@ Houston, TX

    Having the same issue on a different use case, I have view with exposed filters but "Exposed form in block" is disabled. I am using the page view with ajax and also have a view template with a subtitle that should change when filter selections change.
    The view filters are working but when I click on reset the exposed values change but the subtitle in the twig template is not refreshing.

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

    Same issue here after upgrading from Drupal 10.2.10 + better_exposed_filters 6.0.3 to Drupal 10.4.1 + better_exposed_filters 7.0.4 .

    One difference in behaviour here, when using a page display plus block display plus filters in block (rather than a block display on a node): as well as the exposed form elements not resetting, the data displayed is also not resetting. On clicking Reset, the page reloads with the same URL (including filter values), same values selected on the exposed form and same results shown in page display and block display.
    This was working correctly before the upgrade.

Production build 0.71.5 2024