Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#14765 closed defect (bug) (worksforme)

SQL Error filtering posts by category from admin (edit.php)

Reported by: eduardroccatello's profile EduardRoccatello Owned by:
Milestone: Priority: normal
Severity: major Version:
Component: Query Keywords: query, category, posts
Focuses: Cc:



I'm facing this issue with WP 3.0.1.
I've no plugins installed but I've custom post types.

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') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 20

Removing GROUP BY wp_posts.ID the query works in PhpMyAdmin.
Any hint?

Feel free to ask me for details if needed!!!

Change History (2)

#1 @EduardRoccatello
13 years ago

The problem also exists in the frontend (as it is generated in query.php).
Just add ?cat=CAT_ID and you will got the error :-|

query_posts and get_posts do the same.

#2 @dd32
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
  • Version 3.0.1 deleted

I cant duplicate this.

?cat=CAT_ID works for me, Filtering in admin in 3.0 and 3.1 works for me.

The raw SQL even works for me in phpMyAdmin.

Closing as worksforme pending further information to determine exact problem.

Note: See TracTickets for help on using tickets.