Do not return duplicate posts for Meta Queries. Props Greuben. Fixes #17264 for 3.1

git-svn-id: http://svn.automattic.com/wordpress/branches/3.1@17805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2011-05-05 04:08:22 +00:00
parent 61e239a533
commit 695d2fa734
1 changed files with 4 additions and 4 deletions

View File

@ -2231,10 +2231,6 @@ class WP_Query {
}
}
if ( !empty( $this->tax_query->queries ) || !empty( $q['meta_key'] ) ) {
$groupby = "{$wpdb->posts}.ID";
}
// Author/user stuff
if ( empty($q['author']) || ($q['author'] == '0') ) {
@ -2480,6 +2476,10 @@ class WP_Query {
$where .= $clauses['where'];
}
if ( ! empty( $this->tax_query->queries ) || ! empty( $q['meta_query'] ) ) {
$groupby = "{$wpdb->posts}.ID";
}
// Apply filters on where and join prior to paging so that any
// manipulations to them are reflected in the paging by day queries.
if ( !$q['suppress_filters'] ) {