Hi, I have an error with ACF Pro and the The Events Calendar Relationship fields. I am I have tested this on my custom theme and with a brand new clean install with just WordPress, the Twenty Twenty-One Theme, ACF Pro (Version 5.9.9) and The Events Calendar (Version 5.8.1) – all updated.
My issue is that when I create a Field Group and create a field with a type of Relationship and set the (Filter by Post Type) to “Event” (The CPT for The Event Calendar) I go to the post and add the events I have created in the relationship box and save the post all looks to be okay but when I leave the post and then go back to that same post NO events are in the selected area. Yes the output is correct as if i add a event save its shows that event on the front end and if I then go in and add a different event it will show that one.
Again only the theme, acf and event calendar are active on this test to make sure that it is not my custom theme or other plugins affecting it.
I have tried to do some debugging and you are correct. The value is set but when rendering the field to show already selected posts ACF calls get_psots()
with the following arguments
Array
(
[posts_per_page] => -1
[post_type] => Array
(
[0] => tribe_events
)
[post_status] => any
[update_post_meta_cache] =>
[update_post_term_cache] =>
[post__in] => Array
(
[0] => 6092
)
)
and this returns no results. The only conclusion at this point that I can come to is that there is something in the events plugin that is interfering with this query.
I’m experiencing the same problem. I add a new ACF field group with three field types (Post Object, Page Link & Relationship) to a CPT, e.g. “Resources”. For each of the three fields I select the “Event” CPT (tribe_events) for the “Filter by Post Type” option.
When I open a “Resource” for editing, each of the three ACF field populate with the list of events. I then select the event(s) I want and hit the Save/Update button. Upon post back, all three ACF fields are empty.
I find that switching to any other post type works fine, and the selections are saved.
@dwpegues – Have you come across any solutions? I’m hitting the same problem. My current bandaid fix is to add an additional post type. So for me, tribe_event and post. Luckily for me, the client searches for all their related events with the relationship search field. For some reason, adding the additional post type fixes the save issue. Selected events then show. Very odd.
It’s clearly a TEC issue / conflict. I was trying to think of ways to filter the result query but no success.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.