Using both grouped filters and BEF on taxonomy term filters causes a multitude or warnings and notices:

Notice: Undefined index: #default_value in function theme_select_as_checkboxes() (/var/www/sites/all/modules/better_exposed_filters/better_exposed_filters.theme line 84).
Warning: array_search() expects parameter 2 to be array, null given in function theme_select_as_checkboxes() (/var/www/sites/all/modules/better_exposed_filters/better_exposed_filters.theme line 124).

Found and fixed the culprit code, patch attached, please port asap.

Members fund testing for the Drupal project. Drupal Association Learn more


Karsa’s picture

Status: Patch (to be ported) » Needs review
mikeker’s picture

Status: Needs review » Postponed (maintainer needs more info)

Can you give me steps to repro this bug? I'm unable with basic grouped exposed filters and BEF.


Karsa’s picture

Status: Postponed (maintainer needs more info) » Needs work

I added a basic taxonomy term filter, made it grouped, added five options (I think the number of options is key), selected BEF, made my term filter display as checkboxes. And that was all.

Anonymous’s picture

same issue
Notice: Undefined index: og_group_ref_target_id_op in better_exposed_filters_exposed_form_plugin->exposed_form_alter() (line 1263 of /sites/all/modules/better_exposed_filters/

amaisano’s picture

Issue summary: View changes

This is happening for me except with an "Author UID" filter, set to have groups (one option for each of our 2 administrators, plus a default of -any-).

Kojo Unsui’s picture

I had the same notice Undefined index: #default_value in function theme_select_as_checkboxes() (... better_exposed_filters.theme line 84). To reproduce

  • Add a taxonomy exposed filter
  • Use Grouped filters, and miltiple selection
  • in BEF settings for this filter, display as checkboxes

The patch solves it. Thanks

Pere Orga’s picture

I confirm the issue and that the patch fixes the warning. However, the current patch does not follow Drupal coding standards (needs a space after the if)

mauricio.molina’s picture

Status: Needs work » Needs review
625 bytes
None View

Re-rolling the patch against the latest 7.x-3.x-dev branch. Looks like the changes to `` aren't necessary anymore. Also renaming to follow patch standards.

mikeker’s picture

Priority: Major » Normal

PHP notices or warnings are never "Major."

  • mikeker committed 14d019f on 7.x-3.x
    Issue #2032193 by Karsa, mauricio.molina: Better exposed filters...
mikeker’s picture

Status: Needs review » Fixed

@mauricio.molina and @Karsa, thank you for the patches. This fix has been committed.

Status: Fixed » Closed (fixed)

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