Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#14765 closed defect (bug) (worksforme)

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

Reported by: 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)

comment:1 @EduardRoccatello5 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.

comment:2 @dd325 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.