scribu / wp-posts-to-posts

Efficient many-to-many connections between posts, pages, custom post types, users.
http://wordpress.org/plugins/posts-to-posts/
969 stars 260 forks source link

Problem with Private posts #444

Open AliMHGit opened 10 years ago

AliMHGit commented 10 years ago

hey scribu, i cannot get result from querying private posts but when i alter the sql request to

INNER JOIN acwp_p2p WHERE 1 =1 AND acwp_posts.post_type IN ( 'animes', 'manga' ) AND ( acwp_posts.post_status = 'private' OR acwp_posts.post_status = 'private' ) AND ( acwp_p2p.p2p_type = 'Adaptation' AND ( ( acwp_posts.ID = acwp_p2p.p2p_to AND acwp_p2p.p2p_from IN (

SELECT acwp_posts.ID FROM acwp_posts WHERE 1 =1 AND acwp_posts.ID IN ( 3317 ) AND acwp_posts.post_type IN ( 'animes', 'manga' ) AND ( acwp_posts.post_status = 'private' OR acwp_posts.post_author =1 AND acwp_posts.post_status = 'private' ) ORDER BY acwp_posts.post_date DESC ) ) OR ( acwp_posts.ID = acwp_p2p.p2p_from AND acwp_p2p.p2p_to IN (

SELECT acwp_posts.ID FROM acwp_posts WHERE 1 =1 AND acwp_posts.ID IN ( 3317 ) AND acwp_posts.post_type IN ( 'animes', 'manga' ) AND ( acwp_posts.post_status = 'private' OR acwp_posts.post_author =1 AND acwp_posts.post_status = 'private' ) ORDER BY acwp_posts.post_date DESC ) ) ) ) ORDER BY acwp_posts.post_date DESC LIMIT 0 , 30

it work. i couldn't find any place in plugins to solve this issue.

mikemanger commented 9 years ago

FYI, also doesn't seem to work when previewing draft pages.