Support » Plugin: Posts 2 Posts » [Plugin: Posts 2 Posts] 2 Bug Reports

  • Using the plugin API, I have found two errors.

    1) p2p_is_connected – This returns true if the first parameter is connected to anything, regardless whether it is connected to the second parameter.

    2) p2p_connect – I am connecting two custom post types, but the reciprocal argument isn’t working in the ui. If I call it as p2p_connect( cpt1, cpt2 ), it doesn’t show up in the UI, though it is stored correctly and returned correctly using query_posts. If I reverse the arguments however and call p2p_connect( cpt2, cpt1 ), it does show up in the UI.

    Thanks for a great plugin!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author scribu

    (@scribu)

    The first issue is now fixed in the development version (0.5.2-alpha). Thanks for reporting.

    As for the second issue, the arguments are reversed automatically when you use the default UI, so in a sense it’s expected behaviour.

    Thanks for the response.

    On the second issue, why don’t you just pull in any connected posts, rather than restricting it to one direction? I know that I have connected posts now in my database that aren’t showing up.

    Another issue that I have noticed is trying to relate a post type to itself.

    1) When I relate a post type to itself, the p2p UI shows up in every edit screen.

    2) When I use query_posts with the ‘connected’ parameter on the same post type, the query always returns itself with the results.

    Plugin Author scribu

    (@scribu)

    What do you mean by “returns itself” ?

    For example, if I have custom post type ‘shoe’. I connect shoe A to Shoes B and C. When I query for shoes related to A, it returns A, B and C, instead of just B and C.

    Plugin Author scribu

    (@scribu)

    Ok, this is now fixed in the development version. Thanks for reporting.

    On the second issue, why don’t you just pull in any connected posts, rather than restricting it to one direction? I know that I have connected posts now in my database that aren’t showing up.

    I did this. Suppose you query ‘connected’ => ‘A’.

    If there’s a connection A->B and another one B->A, it will choose one or the other, to avoid returning B twice.

    If you happen to have different data attached to each of those connections, this might cause problems.

    I think that it should return the same post twice, with the different p2pmeta information attached to each post. If the user doesn’t want multiple copies of a post returned, they should either remove one of the connections or filter on the p2pmeta to only return one.

    Plugin Author scribu

    (@scribu)

    I guess you’re right. Forcing an arbitrary resolution for duplicates isn’t a good idea. Updated dev version.

    Hi Scribu,

    In the p2p meta box, i had a problem trying to link to a post which has only two letters in his title.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Posts 2 Posts] 2 Bug Reports’ is closed to new replies.