benbalter/WP-Document-Revisions — Issue #3: Media Library query breaks with WPDR enabled
Author: lkraav
Created: 2012-03-07 15:20:01+00:00
State: open

This seems related: https://core.trac.wordpress.org/ticket/12750

Steps to reproduce:
* Edit Post (in my case MarketPress product)
* Set featured image
* Choose last tab, "Media Library"

WordPress database error: [Column 'post_mime_type' in where clause is ambiguous]
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT OUTER JOIN wp_posts wpdr_post_parent ON wpdr_post_parent.ID = wp_posts.post_parent WHERE 1=1 AND (post_mime_type LIKE 'image/%') AND wp_posts.post_type = 'attachment' AND (wp_posts.post_status = 'inherit' OR wp_posts.post_status = 'private') AND ( wpdr_post_parent.post_type IS NULL OR wpdr_post_parent.post_type != 'document' ) ORDER BY wp_posts.post_date DESC LIMIT 0, 10

Disabling WPDR makes this go away.