#7144 closed defect (bug) (fixed)
Group queries with 'group_type' arg return all groups instead matching groups.
Reported by: | rekmla | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.6.1 | Priority: | normal |
Severity: | normal | Version: | 2.6.0 |
Component: | Groups | Keywords: | has-patch |
Cc: |
Description
This issue occurs when using the 'bp_get_taxonomy_term_site_id' filter to override the default table location for the 'bp_group_type' taxonomy.
All groups are being returned, not just groups with a specific group type. I've traced the problem to the function get_sql_clause_for_group_types()
in the class BP_Groups_Group which is failing to preg_match the where clause of the intermediate taxonomy query this function performs. The match is failing if the value of $wpdb->term_relationships
is different than the value at the time the taxonomy query is generated.
This is because restore_current_blog()
happens too early resulting in the wrong $wpdb->term_relationships
value being used in the match.
In 10912: