Support » Plugin: Posts 2 Posts » [Plugin: Posts 2 Posts] Relations not saved

  • Resolved pavelevap

    (@pavelevap)


    Hi, great plugin!

    But there is problem – I can add reletions between my CPT and posts, I can find posts from CPT edit page, I can select them – but they are not saved. When I open my CPT item again, there are no saved relations (also MySQL table is empty)…

    And one feature request – It would be fine to display not only post titles during searching, but for example also category (or publish date)…

    Thank you very much for your help…

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

    (@scribu)

    So you have the wp_p2p and wp_p2pmeta tables in your database, but they remain empty?

    Do you hit the save button after selecting connected posts?

    Yes, exactly. I found some notes about this problem in other topics and tried deactivate / activate once again, but it was not helpfull.

    I also tried development version, but then searching was broken (no posts found) so I switched back to 0.4.

    My code:

    function my_propojeni_sluzeb() {
        if ( !function_exists('p2p_register_connection_type') )
            return;
    
        p2p_register_connection_type( 'sluzba', 'post' );
    }
    add_action('init', 'my_propojeni_sluzeb', 100);

    Edit: Yes, I tried Publish and Update buttons. Or is there any other button for metabox? I do not see it…

    I tried to catch AJAX requests with Firebug, but there were only search requests. I thought that after selecting there will be also AJAX database updating request, but there was not. But maybe it works other way…

    Plugin Author scribu

    (@scribu)

    I tried to catch AJAX requests with Firebug, but there were only search requests. I thought that after selecting there will be also AJAX database updating request, but there was not. But maybe it works other way…

    Yes, the connections are stored when you save the post.

    So, there’s a problem with the table creation.

    Please try to run these following two queries in phpMyAdmin and tell me if you get any errors:

    CREATE TABLE wp_p2p (
    	p2p_id bigint(20) unsigned NOT NULL auto_increment,
    	p2p_from bigint(20) unsigned NOT NULL,
    	p2p_to bigint(20) unsigned NOT NULL,
    	PRIMARY KEY  (p2p_id),
    	KEY p2p_from (p2p_from),
    	KEY p2p_to (p2p_to)
    );
    CREATE TABLE wp_p2pmeta (
    	meta_id bigint(20) unsigned NOT NULL auto_increment,
    	p2p_id bigint(20) unsigned NOT NULL default '0',
    	meta_key varchar(255) default NULL,
    	meta_value longtext,
    	PRIMARY KEY  (meta_id),
    	KEY p2p_id (p2p_id),
    	KEY meta_key (meta_key)
    );

    Sorry, but I am not sure if I understand. Tables are correctly in database with all specified columns above, but they remain empty even if I tried to save many relations…

    Plugin Author scribu

    (@scribu)

    Please try the development version (0.4.1-alpha).

    Latest development version tried – no change, selected relationships are not saved when updating post…

    Oh, I found it!
    I forgot that I have active another your plugin (Custom Field Images).
    After deactivating it works well.
    Maybe there is any conflict with scbFramework?

    What should I do to use both of your plugins?

    I know that this plugin is no longer supported, but what should current users do when there are many data stored? I tried to ask for migration script, but no answer 🙁

    Thank you very much for your help…

    Plugin Author scribu

    (@scribu)

    Maybe there is any conflict with scbFramework?

    Yes, that’s probably it.

    Try installing scbFramework standalone, as described here:

    http://wordpress.org/extend/plugins/scb-framework/installation/

    It did not help me, relations not saved.

    I moved all unzipped files and directory into mu-plugins directory, but “Installation page” is probably deprecated, because I did not find any scb-load.php file? So, I am not sure if I installed it the right way?

    Thank you for your help…

    Plugin Author scribu

    (@scribu)

    Yeah, it won’t work without scb-load.php. Don’t know how it dissapeared.

    It’s present in the development version.

    Note that your directory structure should look like this:

    mu-plugins/scb/
    mu-plugins/scb-load.php

    Great, now it works!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Posts 2 Posts] Relations not saved’ is closed to new replies.