Home › Forums › Calendar Products › Events Calendar PRO › Posts 2 Posts Connections
- This topic has 12 replies, 5 voices, and was last updated 8 years, 8 months ago by Support Droid.
-
AuthorPosts
-
September 14, 2012 at 8:36 am #25097CharlesMember
Hello,
Firstly, thanks so much for a great plugin. It’s exactly what my client needed and has helped me deliver some added value in the project.Here is what I’m trying to accomplish:
We hold events for non-profits. Each event has a unique set of sponsors. I’ve created a custom post type called sponsors. Using the Posts 2 Posts plugin, I’ve registered a connection between tribe_events and sponsors. While editing an event post, I can add sponsors and all seems to be working great.Things break down when I try to display the connected sponsors on a single event post page. I have been in contact with scribu, the Posts 2 Posts author and he isn’t sure why this is happening. As a test, I’ve registered another connection type between two other post types and was able to successfully display connected posts.
The WP Debug bar is giving me the following notices when on the events list page:
NOTICE: wp-content/themes/clarity/events/list.php:33 – Undefined variable: post
NOTICE: wp-content/themes/clarity/events/list.php:33 – Trying to get property of non-objectOn an event detail page, I get the following:
NOTICE: wp-includes/query.php:2800 – Undefined offset: 1
NOTICE: wp-includes/query.php:3592 – Trying to get property of non-object
NOTICE: wp-includes/post-template.php:30 – Trying to get property of non-object
NOTICE: wp-includes/post-template.php:206 – Trying to get property of non-objectIs there any advice you can give me on troubleshooting this issue?
Thanks so much.
September 14, 2012 at 6:09 pm #25155CharlesMemberDoes the fact that I haven’t received any response mean that you don’t believe that this issue is caused by the Event Calendar plugin or is this being investigated?
September 25, 2012 at 10:19 am #25684LeahMemberHey Charles,
I apologize, this thread seems to have slipped through the cracks. I’ve alerted our developers to your problem and one of them will get back to you as soon as possible with a more substantial answer. Thank you for your patience!
Cheers,
LeahSeptember 25, 2012 at 10:58 am #25688JonahParticipantHi Charles,
Can you please provide some more code detail/samples of what you’re working with for the connections. I’m primarily interested in the code you have to display posts on the single event pages. The first errors above seem to indicate problems with the list template, are you trying to display connected posts there too? Can you post code samples for the list too if it’s different from your single event code? Please post to http://snippi.com/
Thanks,
JonahSeptember 25, 2012 at 11:15 am #25690CharlesMemberThanks Jonah! I really appreciate the support. More detail is here: http://snippi.com/s/o3rwn1m
Please Let me know if you need anymore detail.
Thanks!September 25, 2012 at 12:25 pm #25698JonahParticipantHi Charles,
You’re welcome. I couldn’t figure it out myself so I’m going to have to ask another dev to take a look. Stay tuned!
– Jonah
September 25, 2012 at 12:33 pm #25699CharlesMemberThanks Jonah!
September 25, 2012 at 6:24 pm #25727Timothy WoodParticipantHi Charles, I am one of the core devs on The Events Calendar. I have been testing with the code snippit you supplied and when I don’t create the custom post type (CPT) of sponsor I get similar errors:
Notice: Trying to get property of non-object in /wp-content/plugins/posts-to-posts/core/side.php on line 84
Warning: get_object_vars() expects parameter 1 to be object, null given in /wp-content/plugins/posts-to-posts/core/side.php on line 84
Notice: Trying to get property of non-object in /wp-content/plugins/posts-to-posts/core/side.php on line 80
Notice: Trying to get property of non-object in /wp-content/plugins/posts-to-posts/core/side.php on line 80However, when I create a CPT or attach it to an existing post type the errors disappear. I am wondering how you are setting up the CPT and if they are being initialized after ‘p2p_init’ fires. If you don’t mind submitting your code for the CPT as well so I can make sure I am tying into the same CPT logic you have setup.
September 25, 2012 at 9:03 pm #25733CharlesMemberThanks Timothy!
I’ve posted more detail about how I create the custom post type and register the connection here: http://snippi.com/s/ojpsg8n
I really appreciate your time looking into my issue. Thanks!
October 1, 2012 at 7:36 pm #25962Timothy WoodParticipantCharles, I have taken your code snippet and been able to find the issue. Currently it is a conflict with how the Post 2 Post relationship queries are built and how The Event Calendar queries respond when a query is run for events. The issue arrises with how nested select queries function when P2P expects a single column. A side note on this conflict, exposes a bit of a performance hit with how the nested select query operates.
For v2.0.9 this will remain a bug, however if you use the following snippet it will resolve the issue in the interim https://gist.github.com/3815849. In our next release we have overhauled how query management works within TEC quite substantially and this should not be an issue moving forward.
October 1, 2012 at 7:45 pm #25964Timothy WoodParticipantFYI if you are interested in the SQL performance issue it was highlighted in a ticket on the repo this past month, a fix may be in hand at which point may resolve this issue as well. https://github.com/scribu/wp-posts-to-posts/issues/219
October 8, 2012 at 11:55 am #26266LeahMemberHi Charles,
Does Timothy’s code above help you out? We’ll have an official fix out in our next release but hopefully that can tide you over until then. If you have any other questions, don’t hesitate to reach out.
Cheers,
LeahJuly 7, 2015 at 6:26 am #977938Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Posts 2 Posts Connections’ is closed to new replies.