When we have selected filters and go back, all selected values was unchecked

Created on 1 June 2021, over 3 years ago
Updated 20 April 2023, over 1 year ago

Problem/Motivation

I have a search page with views exposed filters and AJAX enabled. When we selected a few filters and clicked back, all the selected filters were unchecked.

Steps to reproduce

  • Create views page with exposed filters
  • Enable Ajax
  • Enable views_ajax_history module
  • Go to the views page and checked few filters
  • Click back and see at all filters are unchecked

Proposed resolution

if (!form_values[this.name]) {
  if (currentQuery[this.name]) {
     delete currentQuery[this.name];
  }
  else if (options.data[this.name]) {
    delete options.data[this.name];
  }
}

In this code, form values are array of objects but not simple array with values and this condition if (!form_values[this.name]) always returns false.
Need to compare each form value name with each checkbox name.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇲🇩Moldova chiril.ungureanu

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024