Opened 17 years ago
Closed 17 years ago
#9985 closed defect (bug) (fixed)
'category__and' stopped working
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8 | Priority: | high |
| Severity: | major | Version: | 2.8 |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
Operating System: Ubuntu 9.04
Webserver: Apache 2.2.11
PHP: 5.2.6
MySQL: 5.0.75
Wordpress Version: Nightly build 05/29/09 -> 2.8-beta2 changeset 11491
Works fine with Wordpress 2.7.1.
Steps to Reproduce:
1) Create two categories lets say catA (id: 3) and catB (id: 6).
2) Create a post with the two categories selected and publish it.
3) Modify the WP loop query in the theme to:
query_posts(array('categoryand'=>array(3,6), 'showposts'=>3));
Result:
No post show up in the WP loop.
SQL Query Log:
090530 12:32:22 40 Connect cb_wp_main@localhost on
40 Query SET NAMES utf8
40 Init DB cb_wp_main
40 Query SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
40 Query SELECT * FROM wp_users WHERE user_login = 'admin'
40 Query SELECT meta_key, meta_value FROM wp_usermeta WHERE user_id = 1
40 Query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
40 Query SELECT FOUND_ROWS()
40 Query SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (8, 5, 1) ORDER BY t.name ASC
40 Query SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (8,5,1)
40 Query SELECT YEAR(post_date) ASyear, MONTH(post_date) ASmonth, count(ID) as posts FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC
40 Query SELECT * FROM wp_posts WHERE (post_type = 'page' AND post_status = 'publish') AND ( ID <> 133 AND ID <> 113 ) ORDER BY menu_order ASC
40 Query SELECT option_value FROM wp_options WHERE option_name = 'page_for_posts' LIMIT 1
40 Query SELECT p.ID FROM wp_posts p INNER JOIN wp_term_relationships tr ON (p.ID = tr.object_id) INNER JOIN wp_term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN wp_terms t ON (tt.term_id = t.term_id) WHERE tt.taxonomy = 'category' AND t.slug IN ('3', '6') GROUP BY p.ID HAVING count(p.ID) = 2
40 Query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND 0 = 1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 3
40 Query SELECT FOUND_ROWS()
40 Query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('4') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 3
40 Query SELECT FOUND_ROWS()
40 Query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('5', '6', '7', '8', '9') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 7
40 Query SELECT FOUND_ROWS()
40 Query SELECT * FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 15
40 Query SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('category') ORDER BY t.name ASC
40 Query SELECT * , IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated FROM wp_links WHERE 1=1 AND link_visible = 'Y' ORDER BY wp_links.link_id ASC
40 Quit
[11348] is possibly related.