Plugin Author
scribu
(@scribu)
“The above code” is pretty vague, since you say that the ‘p2p_admin_box_show’ filter still works.
Hi scribu,
Sorry you are absolutely right, the code I pasted in pastebin is regarding the backend connection which still works. I don’t have the frontend code on me right now so I will have to get back to you on that. I downgraded to the 1.4-alpha and it’s working again somehow…
Will get back to you when I can!
Thanks, Toine
Hi Scribu,
Sorry it took so long, I was away on holiday.
First of all when I update the posts-to-posts 1.4-alpha to the posts-to-posts 1.4.1 version, I get the following error in the WP admin:
Warning: get_object_vars() expects parameter 1 to be object, null given in /path-to-wordpress-installation/wp-content/plugins/posts-to-posts/core/side.php on line 83
Besides that, some connections just simply dissapear. For example, the following connection I defined in my functions.php doesn’t show up anymore after the update, while the connections in the admin page ares till there: http://pastebin.com/ajEg1Hdk
The 1.4 version simply just not work for me I’m afraid.
Any ideas on what may be causing these failures?
Thanks again for your time!
Plugin Author
scribu
(@scribu)
What does get_queried_object()
return on the “homepage template” ?
Warning: get_object_vars() expects parameter 1 to be object, null given
That’s usually an indication that the post type doesn’t exist.
What do you mean exactly with ‘What does get_queried_object() return on the “homepage template”‘? How can I test/print this?
The post type does exist because right now all my connections work perfectly without any errors with the 1.4-alpha version, that’s the weird thing about it… The moment I update, I get the error and my connection on the homepage is gone.
Thanks, here’s my output of the var_dump in pastebin:
var_dump(get_queried_object());
The page ID seems to be right: ["ID"]=> int(14)
Only thing that seems weird is the part after ["guid"]=> string(60)
that’s an very old and outdated url, but I don’t think that has got anything to do with these problems…
I really don’t get it…
I cleaned up my p2p_register_connection_type
codes to the latest syntax and tried to update again to 1.4.1 and at least the error has dissapeared.
However some of my connections still dissapear but only on the frontend! In the WP backend under Tools > Connection Types they’re all there!
I’m using the following code in my sidebar.php and it just won’t work:
http://pastebin.com/69DivrNX
When I echo the amount of connections: echo count($connected);
it just keeps returning 1 while at the backend there are 4 connections present!
Any help would be appreciated, thanks!
Plugin Author
scribu
(@scribu)
count($connected)
will always return 1. What you need is count($connected->posts)
.
Are you sure those 4 posts have 'post_status' => 'publish'
?
Yup, I’m sure! count($connected->posts)
returns 0 by the way
I discovered something weird though, I copied both the 1.4-alpha as well as the 1.4.1 plugin folders into the wp-content/plugins folder and renamed the 1.4.1 version to: posts-to-posts-1.4.1. So the 1.4-alpha plugin is till named posts-to-posts. Then I activated the 1.4.1 version and everything works all of a sudden! When I delete the 1.4-alpha folder I obviously get an error but there’s some function in the 1.4-alpha version that’s different somehow…
Plugin Author
scribu
(@scribu)
Please send me this ‘1.4-alpha’ version you have in a zip: mail @ scribu.net
Plugin Author
scribu
(@scribu)
Hm… I don’t see it. Try scribu @ gmail.com instead.
Plugin Author
scribu
(@scribu)
Yep, got both actually; must have been a delay.