[buddypress-trac] [BuddyPress Trac] #7144: Group queries with 'group_type' arg return all groups instead matching groups.

buddypress-trac noreply at wordpress.org
Sun Jun 26 20:34:07 UTC 2016


#7144: Group queries with 'group_type' arg return all groups instead matching
groups.
--------------------------+-----------------------------
 Reporter:  rekmla        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Groups        |    Version:  2.6.0
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 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.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7144>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list