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.
Comment | File | Size | Author |
---|---|---|---|
#2 | bef-2189321-2.patch | 1.47 KB | asgorobets |
#1 | bef-2189321.patch | 1.47 KB | asgorobets |
Comments
Comment #1
asgorobets CreditAttribution: asgorobets commentedComment #2
asgorobets CreditAttribution: asgorobets commentedHere is an updated patch that fixes is_secondary check that was failing.
Comment #3
mikeker CreditAttribution: mikeker commentedCommitted.
Thank you for the bug report and the patch.