[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
Mon Sep 15 13:54:55 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: |
--------------------------+------------------------------
Comment (by boonebgorges):
> What I'm saying is that maybe the comma syntax (which I try and steer
clear of) is the cause of the problem.
Yes, I get that, and I agree that it's good to avoid. But it is very
complicated to change this syntax, because we have a variety of backward
compatibility issues to solve first. See #5451.
The purpose of the transformations in get_meta_query_sql() is to continue
using the comma syntax even though WP_Meta_Query::get_sql() outputs INNER
JOIN syntax. This is working in our unit tests, and yours is the first
instance I've heard of where this issue specifically (SQL syntax) is
causing meta_query to break. So, for the time being, I'm strongly inclined
to find out what's causing the problem in your specific case, rather than
doing the major refactoring your suggestion would require.
You may also take a look at #5824. It's possible that the changes in
2.1/trunk related to this ticket would also address what you're seeing
(though tbh I can't see at a glance how this would be the case).
> Perhaps you need a unit test for different meta_value but using the same
key?
I have written such a test locally, and I have also done the test manually
as you described above, and in all cases I'm unable to reproduce.
If you can share the pre- and post-processed SQL, I might be able to see
what's up.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5874#comment:10>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list