[buddypress-trac] [BuddyPress Trac] #5874: BP_Groups_Group::get() returns incorrect results when using meta_query with multiple meta_values and OR relationship

buddypress-trac noreply at wordpress.org
Sun Sep 14 23:31:58 UTC 2014


#5874: BP_Groups_Group::get() returns incorrect results when using meta_query with
multiple meta_values and OR relationship
--------------------------+------------------------------
 Reporter:  richtelford   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Groups        |     Version:
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+------------------------------
Changes (by boonebgorges):

 * component:  Core => Groups


Comment:

 Thanks for the report. This test
 https://buddypress.trac.wordpress.org/browser/trunk/tests/phpunit/testcases/groups
 /class-bp-groups-group.php#L137 passes, and it looks the same as your
 test. I also tested manually and it appears to be working as expected with
 data like you've presented here.

 >  I noticed that table joins in BP_Groups_Group::get() and
 get_meta_query_sql() are done using commas rather than INNER JOIN, etc. I
 changed the functions to use INNER JOIN instead and it now works correctly
 on my test site

 BuddyPress handles the necessary transformation - see
 https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups/bp-
 groups-classes.php#L849 There may be something on your installation that
 is causing the preg_match_all() checks there to fail. Could you try
 debugging in this area? You may also try disabling other plugins in case
 there is one that is doing something to the syntax of the query.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5874#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list