WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] No connections working after last update (13 posts)

  1. ryansigg
    Member
    Posted 2 years ago #

    Just updated to 1.2. It must have been a while; I had to go into the new Admin page (nice!) and convert the weird connection types (with names something like '424545asvgg38476") to their correct registered connection types.
    Then I updated the queries to work with the new version.

    Yet none of my connections are working.

    What's REALLY weird, is that (whether I use WP_Query or get_posts) the results don't change even when I delete the 'connected_type' or 'connected_item' parameters.

    I've been using Posts2Posts since version 0.5, and I've never really had many issues...
    What am I doing wrong? Thanks in advance...

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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/

  3. ryansigg
    Member
    Posted 2 years ago #

    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.

  4. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    The queries look fine. Maybe it's another plugin interfering.

  5. ryansigg
    Member
    Posted 2 years ago #

    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.

  6. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    Try doing var_dump( get_post_type( $child_id ) ); right before the get_posts() call. You should get 'cruise' or 'ship'.

  7. ryansigg
    Member
    Posted 2 years ago #

    I see 'ship'.

  8. ryansigg
    Member
    Posted 2 years ago #

    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?

  9. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  10. ryansigg
    Member
    Posted 2 years ago #

    Ok, tried that... Please take a look, thanks:
    http://pastebin.com/EAWhUdph

  11. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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

  12. ryansigg
    Member
    Posted 2 years ago #

    Sending email. Thanks!

  13. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    The issue is resolved in the development version (1.3-alpha3).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic