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).
Files: 
CommentFileSizeAuthor
#5 bef-2095605-5.patch5.42 KBtim.plunkett
Test request sent.
[ View ]
#3 bef.2095605.wrong-handling-of-grouped-filters-with-ids.3-d7.patch24.9 KBMyXelf
Test request sent.
[ View ]
#1 grouped_identifier.patch818 bytesthesame-
Test request sent.
[ View ]

Comments

thesame-’s picture

StatusFileSize
new818 bytes
Test request sent.
[ View ]

Not sure if this is good approach, but it worked for me.

Ben Young’s picture

Confirming the patch works on 7.x-3.0-beta3, will need to be rerolled against dev

MyXelf’s picture

Title:Changing filter identifier of grouped filter throws error» Wrong handling of grouped filters with identifiers
Version:7.x-3.0-beta3» 7.x-3.x-dev
Status:Active» Needs review
StatusFileSize
new24.9 KB
Test request sent.
[ View ]

The 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 the
loop 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

MyXelf’s picture

Issue summary:View changes

Bumping 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

tim.plunkett’s picture

StatusFileSize
new5.42 KB
Test request sent.
[ View ]

I haven't actually reviewed this patch, just rerolling and reducing the size by not renaming the variable.

  • mikeker committed c0316d6 on 7.x-3.x authored by MyXelf
    Issue #2095605 by tim.plunkett, MyXelf, thesame-: Fixed Wrong handling...
mikeker’s picture

Status:Needs review» Fixed

@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.

Status:Fixed» Closed (fixed)

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