Problem/Motivation

This issue is a followup to #1983960: Secondary options closed after submit.
Basically #1983960: Secondary options closed after submit did the job, except of cases when filter identifier was modified in Views UI.
Here is the code:

foreach ($this->view->get_exposed_input() as $key => $value) {
  if (!empty($value) && isset($settings[$key]['more_options']['is_secondary'])) {
    $secondary_collapse = FALSE;
    break;
  }
}

From code we can notice that exposed input array keys are checked to be marked in BEF options as 'is_secondary'. The issue is that $key from that foreach is actually not the filter name, but filter identifier. And because BEF uses filter names to store their options, they just don't match.

An example would be:

$key = 'categories'; // renamed term_node_tid_depth for better DX/UX.
$filter_name = 'term_node_tid_depth' // filter machine name used by Views and BEF accordingly.

Proposed resolution

I think we should better check for filter identifiers and ensure this solution works with any exposed filter.

CommentFileSizeAuthor
#2 bef-2189321-2.patch1.47 KBasgorobets
#1 bef-2189321.patch1.47 KBasgorobets
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asgorobets’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.47 KB
asgorobets’s picture

FileSize
1.47 KB

Here is an updated patch that fixes is_secondary check that was failing.

mikeker’s picture

Status: Needs review » Fixed

Committed.

Thank you for the bug report and the patch.

Status: Fixed » Closed (fixed)

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