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.
When I change filter identifier of grouped filter I get this error:
Notice: Undefined index: filter-field_route_length_value better_exposed_filters_exposed_form_plugin->exposed_form_alter() (rinda 590 no domain.lv/sites/all/modules/better_exposed_filters/better_exposed_filters_exposed_form_plugin.inc).
Comment | File | Size | Author |
---|---|---|---|
#5 | bef-2095605-5.patch | 5.42 KB | tim.plunkett |
#3 | bef.2095605.wrong-handling-of-grouped-filters-with-ids.3-d7.patch | 24.9 KB | MyXelf |
#1 | grouped_identifier.patch | 818 bytes | thesame- |
Comments
Comment #1
thesame- CreditAttribution: thesame- commentedNot sure if this is good approach, but it worked for me.
Comment #2
Ben Young CreditAttribution: Ben Young commentedConfirming the patch works on 7.x-3.0-beta3, will need to be rerolled against dev
Comment #3
MyXelf CreditAttribution: MyXelf commentedThe patch in #1 is the tip of the iceberg. At the end this became a megapatch, that I don't know if could/should be splitted into several issues. The summary:
BETTER EXPOSED FILTERS - Issue #2095605 . 3 - Breakdown
=======================================================
* BUG #1 - Done!
Issue: PHP undefined index when refering to grouped filters (line 851).
Based on previous patch.
* BUG #2 - Done!
Issue: PHP undefined index when grouped filters are set as secondary option (line 1316).
Extension of the previous patch.
* BUG #3 - Done!
Issue: The BEF Settings in the "Exposed Form" section of the Views UI,
reflects incorrect information for grouped filters (Display as... and More options...).
* BUG #4 - Done!
Issue: Only the last exposed filter will get an override of the "ANY"
option label (if happens to have one).
Because the // Override "Any" label, if applicable segment is outside the
foreach ($settings as $label => $options)
loop checking the settings.While doing Refactor #1, there were two
$field_id
instances outside theloop that defines it (logically this wasn't the intention).
WARNING: This must be done before checking if this is a secondary element,
otherwise the reference will be already gone at the checking point (BUG#5?).
* REFACTOR #1:
$field_id
=>$filter_id
(96 substitutions): The variable will be refering to filters, not fields.
When this can be the same, every filter with an specified "id" will differ.
* REFACTOR #2:
["filter_$label"]
=>[$filter_key]
(11 substitutions)
HTH
Comment #4
MyXelf CreditAttribution: MyXelf commentedBumping this and hoping for some luck from the module maintainer. All the tests on this branch are Postponed for some stated reasons in 'qa.drupal.org'.
I've tested this on a production site, and so far is working good. I'm afraid this huge patch getting outdated and needing to be rerolled again.
HTH
Comment #5
tim.plunkettI haven't actually reviewed this patch, just rerolling and reducing the size by not renaming the variable.
Comment #7
mikeker CreditAttribution: mikeker commented@MyXelf: Thank you for the patch and the thorough description of what it's doing in #3. My apologies for letting this slip off my radar. I appreciate everyone's patience.
I've committed the patch from #5 (without the variable renaming) as that was easier to review. I agree, however, that
$field_id
should be renamed to$filter_id
for the reasons you state. I'll take care of that along with some other upcoming code refactoring.