Plugin Author
scribu
(@scribu)
So, do the connections show up when editing a post in wp-admin?
Also, please post the code for a query that doesn’t work, along with the corresponding p2p_register_connection_type() call in a http://pastebin.com/
Sorry, I accidentally posted the link to the plugin instead of the link to my pastebin up there. Haha, ahem…
Here’s the forgotten link: http://pastebin.com/VSHEY8GN
And yes, after converting the connection types, they show up on post edit page.
Plugin Author
scribu
(@scribu)
The queries look fine. Maybe it’s another plugin interfering.
I deactivated all plugins except for Posts2Posts and I get the same exact results?
Could there be something going on with my tables?
In the wp_p2p table I see: p2p_id, p2p_from, p2p_to, p2p_type
Here’s some additional info; when I use the get_posts option and remove 'suppress_filters' => false I get lots of results, but all different posts that have nothing to with the connection type.
If I keep 'suppress_filters' => false then I get zero results.
Thanks for your help so far. As I said, I’ve used this plugin for a long while now and this is the first time I’ve had any trouble.
Plugin Author
scribu
(@scribu)
Try doing var_dump( get_post_type( $child_id ) ); right before the get_posts() call. You should get ‘cruise’ or ‘ship’.
I’ve gone through and checked the rest of the code used to display the results but everything seems fine on that end.
Any other ideas?
Could I perhaps persuade you to take a look at my installation?
Plugin Author
scribu
(@scribu)
One more thing to try:
function debug_wp_query( $posts, $wp_query ) {
echo '<pre>';
var_dump( $wp_query->request );
echo '</pre>';
return $posts;
}
add_filter( 'the_posts', 'debug_wp_query', 10, 2 );
This should show you the final SQL generated for each WP_Query run. See if you find anything suspicious.
Ok, tried that… Please take a look, thanks:
http://pastebin.com/EAWhUdph
Plugin Author
scribu
(@scribu)
The problem in the second query is this: AND wp_posts.post_type = 'post'
So yeah, I can take a look at your site. Send me an email: mail AT scribu.net
Plugin Author
scribu
(@scribu)
The issue is resolved in the development version (1.3-alpha3).