WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] Relations not saved (13 posts)

  1. pavelevap
    Member
    Posted 3 years ago #

    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...

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    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?

  3. pavelevap
    Member
    Posted 3 years ago #

    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...

  4. pavelevap
    Member
    Posted 3 years ago #

    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...

  5. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    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)
    );
  6. pavelevap
    Member
    Posted 3 years ago #

    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...

  7. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Please try the development version (0.4.1-alpha).

  8. pavelevap
    Member
    Posted 3 years ago #

    Latest development version tried - no change, selected relationships are not saved when updating post...

  9. pavelevap
    Member
    Posted 3 years ago #

    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...

  10. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    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/

  11. pavelevap
    Member
    Posted 3 years ago #

    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...

  12. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    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
  13. pavelevap
    Member
    Posted 3 years ago #

    Great, now it works!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic