• Resolved salocined

    (@salocined)


    I have 3 connections widget box for my post in admin.

    First connection box works perfectly when typing first few letter (automatically finds related) or when using the View all link.

    My other 2 widget box don’t work when starting typing, only the View all links will display the full list of connected post.

    any idea?

    thx
    s

    https://www.ads-software.com/extend/plugins/posts-to-posts/

Viewing 15 replies - 16 through 30 (of 30 total)
  • Thread Starter salocined

    (@salocined)

    Plugin Author scribu

    (@scribu)

    Ok, so the ‘client’ role has the ‘edit_offers’ capability, right?

    Thread Starter salocined

    (@salocined)

    yes they do, they can post/edit offers.

    Plugin Author scribu

    (@scribu)

    This code works fine for me, on WP 3.2.1, with the development version I last linked to:

    add_action( 'init', 'init_stuff' );
    
    function init_stuff() {
    	register_post_type( 'company', array(
    		'public' => true,
    		'label' => 'Companies',
    		'capability_type' => 'company'
    	) );
    
    	register_post_type( 'offer', array(
    		'public' => true,
    		'label' => 'Offers',
    		'capability_type' => 'offer'
    	) );
    
    	p2p_register_connection_type(array(
    		'id' => 'posts_to_offer',
    		'from' => 'post',
    		'to' => 'offer',
    		'reciprocal' => true
    	));
    
    	p2p_register_connection_type(array(
    		'id' => 'company_to_offer',
    		'from' => 'company',
    		'to' => 'offer',
    		'reciprocal' => true
    	));
    }

    If you’re using a plugin to register the post types, disable it and try the above code instead.

    If it still doesn’t work, it means there’s some other plugin interfering.

    Thread Starter salocined

    (@salocined)

    Thanks scribu
    I will have a look at this tomorrow

    Thx Again for your support, not sure how you manage but you are a rare one that everybody needs.

    I will be more than happy to contribute to a nice xmas present or a beer fund if you have something set up somewhere

    Plugin Author scribu

    (@scribu)

    You’re welcome. The beer fund is at https://scribu.net/paypal ??

    Thread Starter salocined

    (@salocined)

    me again sorry…

    Whatever I try, same issue.

    Only Admin seem to be able to Connect a post to a Custom Post Type (Offer or Destination).

    Editor or in my case Client, even with the correct rights set up in Adminize, cannot link a Post to a Custom post type.

    I cant understand what’s wrong.

    HELP…please ??

    Thread Starter salocined

    (@salocined)

    trying to debug, and the console throws the errors here
    https://pastebin.com/55FHrYNm

    if (!response.rows) {

    Plugin Author scribu

    (@scribu)

    Did you try deactivating all other plugins?

    Did you try the code I posted last time?

    Are you on the development version (1.0.1-alpha2)?

    Thread Starter salocined

    (@salocined)

    Ok some update on this.

    Running version (1.0.1-alpha2)

    Using your code above APART from Capability type of my Custom Post Type.
    In your code you wrote ‘capability_type’ => ‘company’
    In my code I have ‘capability_type’ => ‘page’

    If I change it Company, I lose my CPT in dashboard.

    Running all this, I only get the Connected Post metabox (no Company or Destination).
    puzzled….

    Thread Starter salocined

    (@salocined)

    Just realized something.

    Offers = Post
    Destination = Pages.

    Connection works from Post to Offer (reciprocal)

    Connection dont work from Post to Destination (capability page)

    which is normal, as your plugin is called POSTS 2 POSTS….

    BUT, why can I create the connections when logged in as an ADMIN?

    Plugin Author scribu

    (@scribu)

    Connection dont work from Post to Destination (capability page)

    which is normal, as your plugin is called POSTS 2 POSTS…

    That is incorrect. It should work between any post type, with any capability setting (as long as the user’s role has the appropriate capabilities).

    Have you tried deactivating all other plugins, like I suggested? Also might be a good idea to switch to the bundled theme.

    Thread Starter salocined

    (@salocined)

    I did deactivate the plugins. not results.

    I am glad the connection works between CPT (posts or pages) and posts.

    In your code, why is the capability_type is set to the same name as the post type?
    I thought only a Type of Post or Page can be set there? (if i change this, I lose my CPT)
    s

    Plugin Author scribu

    (@scribu)

    Listen, how about we talk via IRC? I’m in the #wordpress channel on freenode.

    Thread Starter salocined

    (@salocined)

    Finally fixed it thx to Scribu.

    My CPT had Page capability and my client didnt have permission to edit Pages, hence the box not working.
    Removing the capability_type for my CPT fixed my issue.

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘[Plugin: Posts 2 Posts] Widget in admin not finding connection’ is closed to new replies.