Issue with Exposed Filter Links Disappearing After Selection in View Block with AJAX

Created on 31 January 2024, 11 months ago
Updated 6 February 2024, 11 months ago

I am encountering an issue with an AJAX-enabled view block that features a taxonomy filter. The filter includes the following options:

All
Item 1
Item 2
Item 3
Item 4
Upon page load, all filter options are visible. However, when I select any option, it causes the other options to disappear. For instance, if I select "Item 1," only the "All" and "Item 1" filters are displayed, hiding the other options.

To provide context, I have enabled the "Show only used items" option and disabled the "Filter items based on the filtered result set by other applied filters" option.

Upon investigating a previous issue, I found that the following code was removed:

else {
  if (!empty($settings['options_show_only_used_filtered'])) {
    $user_input = $form_state->getUserInput();
    if (isset($user_input[$identifier])) {
      unset($user_input[$identifier]);
    }
  }
  else {
    $user_input = [];
  }
  $form_state->setUserInput($user_input);
}

To address this issue, I have submitted a new patch, removing the mentioned if condition, as it was identified as the cause of the problem described in issue 3132480:

else {
  if (empty($settings['options_show_only_used_filtered'])) {
    $user_input = [];
    $form_state->setUserInput($user_input);
  }
}

I have not been able to test this code against the problem outlined in issue 3132480 as I am unable to replicate the reported issue. The details of the patch and related code changes can be found in the issue link: https://www.drupal.org/project/selective_better_exposed_filters/issues/3... 🐛 Filter terms based on "options_show_only_used_filtered" set not working as expected Fixed

📌 Task
Status

Needs review

Version

3.0

Component

Code

Created by

🇮🇳India Manthan.Chauhan

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

Comments & Activities

Production build 0.71.5 2024