Forum Replies Created
-
AuthorPosts
-
mcmasterMemberp.s. saving a copy of the database first and can provide it to you if it might be helpful in diagnosing the problem
mcmasterMemberBreakthrough! I accidentally discovered that when I updated (saved) a page, suddenly the related projects appeared on the page. Likewise, the project page now lists that one page. So I’m going to update all the pages and see if the rest of the data shows up.
mcmasterMemberSo the good news is that I can see the post relationships field when editing a page. The bad news is that when I try to retrieve using the legacy code, I get nothing back. Was there a change? Does it now need a field name? Or ??
Again, this is what I have been using, and what worked until 0.9.9:
$args = array( 'post_type' => 'page', // Set post type you are relating to. 'posts_per_page' => -1, 'post_has' => $post->ID, 'suppress_filters' => false, // This must be set to false ); $list = get_posts( $args );
mcmasterMember@Kevin, you really need a way to manually trigger updates!
My first try:
– removed the add-more files from piklist/parts/meta-boxes, leaving just the post-relate fields
– replaced plugin files for 0.9.9.5 with 0.9.4.29
– went into Piklist settings so that it theoretically knew it was running 0.9.4.x
– replaced files for 0.9.4.29 with 0.9.9.5
– back to Piklist settings
– nothing2nd try:
– removed the whole piklist subdirectory from my theme so I could deactivate Piklist
– deactivated 0.9.9.5
– replaced plugin files for 0.9.9.5 with 0.9.4.29
– activated 0.9.4.29
– deactivated 0.9.4.29
– replaced files for 0.9.4.29 with 0.9.9.5
– replaced the piklist subdirectory into my theme
– activated 0.9.9.5
– nothing3rd try:
– removed the piklist subdirectory
– deactivated 0.9.9.5
– replaced plugin files for 0.9.9.5 with 0.9.4.29
– replaced the piklist subdirectory into my theme
– activated 0.9.4.29
– edited a page with the post-relate fields (they are there)
– removed the piklist subdirectory
– deactivated 0.9.4.29
– replaced files for 0.9.4.29 with 0.9.9.5
– replaced the piklist subdirectory into my theme
– activated 0.9.9.5
– edited a page with the post-relate fields
– nothingThat’s not counting the times that I forgot to remove or replace the piklist parts files. 😉
So I studied the Piklist code. I edited
Piklist_Admin::check_updateline 719 to always be true, andPiklist_Admin::get_updateline 799 be true for version number ‘0.9.9.’ This forced Piklist to offer me the update. For some reason it displayed everything twice, but otherwise seemed to run fine. It did not list the post-relate field in its output report (see image), but I now have the post relationships back.Donna
Attachments:
You must be logged in to view attached files.
mcmasterMemberIs there a way to run the upgrade script without going back to a previous version of Piklist and then upgrading again?
Also, I don’t want the add-mores to be re-converted, so I’m thinking the best plan is to temporarily remove those files from Piklist parts folders during the upgrade.
Thanks,
Donna
mcmasterMemberI just saw another post https://piklist.com/support/topic/how-are-post-relationships-stored/ which indicates that the post-relate data was stored in a table called
wp_piklist_cpt_relate. However, this table wasn’t present in the current DB or in my backups.The metabox code, FYI:
/* Title: Related Projects Post Type: page Description: list of projects related to this page */ piklist('field', array( 'type' => 'post-relate', 'scope' => 'project', 'template' => 'field', 'field' => 'related_project', 'label' => 'Related Projects', ));And the code to retrieve the pages related to a specific project:
$args = array( 'post_type' => 'page', // Set post type you are relating to. 'posts_per_page' => -1, 'post_has' => $post->ID, 'suppress_filters' => false, // This must be set to false ); $list = get_posts( $args );
mcmasterMemberI tried removing the line:
'template' => 'field',from the group definition, and the results were not better. 😉
Again, if I’m being clumsy with my field definitions, please let me know!
Thanks,
DonnaAttachments:
You must be logged in to view attached files.
mcmasterMemberThanks, Carla, I had the same trouble! 🙂
October 23, 2015 at 8:00 pm in reply to: Critical: Preview while editing metaboxes causes data loss #4725
mcmasterMemberNever mind, will email you the plugin zip.
October 23, 2015 at 7:59 pm in reply to: Critical: Preview while editing metaboxes causes data loss #4724
mcmasterMemberI can’t give you access to the live site. I just tested on my dev site, and was able to reproduce with the 2015 theme and all plugins disabled except for Piklist and a stripped down version of my Piklist add-on plugin.
I’m attaching a zip of my plugin. I can also provide you with a database export and/or set up a test account on my server.
October 23, 2015 at 7:07 pm in reply to: Critical: Preview while editing metaboxes causes data loss #4721
mcmasterMemberoops, forgot to mention this is 0.9.9.4
mcmasterMemberhappening with double-quotes in text fields as well … just realized it’s adding slashes every time I save *urk*
Attachments:
You must be logged in to view attached files.
mcmasterMemberp.s. adding
stripslashesto my processing is a workaround:$highlights = wptexturize( wpautop( stripslashes( $data['newsletter_highlights'] ) ) );
mcmasterMember@ndbe, what version of Piklist are you using? I think this may be a bug that is fixed in the current Beta, 0.9.9.4.
mcmasterMemberAh, I see. I’ll play with that. Thanks!
-
AuthorPosts