Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | bef_grouped_filters_bug-2032193-8.patch | 625 bytes | mauricio.molina |
bef_grouped_filters_bug_2013-07-01.patch | 1.46 KB | Karsa | |
Comments
Comment #1
Karsa CreditAttribution: Karsa commentedComment #2
mikeker CreditAttribution: mikeker commentedCan you give me steps to repro this bug? I'm unable with basic grouped exposed filters and BEF.
Thanks.
Comment #3
Karsa CreditAttribution: Karsa commentedI 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.
See: http://karsa.org/views_test/articles_bef
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedsame 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/better_exposed_filters_exposed_form_plugin.inc).
Comment #5
amaisano CreditAttribution: amaisano commentedThis 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-).
Comment #6
Kojo Unsui CreditAttribution: Kojo Unsui commentedI had the same notice Undefined index: #default_value in function theme_select_as_checkboxes() (... better_exposed_filters.theme line 84). To reproduce
The patch solves it. Thanks
Comment #7
Pere OrgaI 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
)Comment #8
mauricio.molina CreditAttribution: mauricio.molina commentedRe-rolling the patch against the latest 7.x-3.x-dev branch. Looks like the changes to `better_exposed_filters_exposed_form_plugin.inc` aren't necessary anymore. Also renaming to follow patch standards.
Comment #9
mikeker CreditAttribution: mikeker commentedPHP notices or warnings are never "Major."
Comment #11
mikeker CreditAttribution: mikeker commented@mauricio.molina and @Karsa, thank you for the patches. This fix has been committed.