That's about it what I wrote in the title. Happens in situation where BEF and Views Selective Exposed Filters are working together, and VSEF returns an empty set of filters.

Asking for advice here as I didn't delved into the issue myself yet.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

d.clarke’s picture

If I understand this issue correctly, you are saying that if you have an exposed filter that provides a drop down list of options and then you change it in the "BEF Settings" to be displayed as "Checkboxes/Radio Buttons" if there are no options available for that filter, the filter will be displayed in its default state... an empty drop down.

If this a correct understanding of the reported issue, this issue occurs in better_exposed_filters_exposed_form_plugin.inc on line 936. If the options array is empty the display will be reset back to the default format. This was part of commit 93d27e39 which was a fix for ticket #1912684: Error in line 752 and 752 of better_exposed_filters_exposed_form_plugin.inc. I think it was intended to handle cases where the filter is an auto-complete filter but BEF was trying to convert it to a drop down or radio/checkbox list. Since it was an autocomplete, there were no #options and as a result it was causing errors. The patch checked if the #options was empty() but that accidentally includes the scenario documented in this ticket where the #options array is set but it is set to null or an empty array.

Attached is a patch that I think will address both cases. By changing it from an empty() check to an array_key_exists() it should handle both cases.

d.clarke’s picture

Status: Active » Needs review
mikeker’s picture

Thanks!

It's been committed.

mikeker’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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