Home › Forums › Bug Reports › Relationship field loses post type after save
When adding selecting custom post types from a relationship field, they initially show the post type eg. post, page etc but when the current page/post is saved they all show the post type of the current page/post.
eg. on a page, select relationship to a post and a page. They show as page and post. After save they both show as page
I’m experiencing the same exact issue. I’m on the latest version of ACF and the ACF Repeater plugin.
I am also experiencing the same issue in the latest plugin version with Page Link (reverts to the first page but the front-end there is nothing printed out), File (acts like no file was added), and Text (becomes blank); I am using them all in a repeater field as choices to link a section to. In every case, when calling the_field(), it returns nothing to the front end. I’ve also tried changing the field names to all three be separate names and the same problem arises.
I’d like to add that I have noticed the issue also appearing with multiple WYSIWYG editors in a repeater field.
Can anyone recommend a quick patch? We have clients depending on this feature and it’s proving to be really annoying with the amount of possible relationships being displayed to them.
I too have clients depending on the feature but have yet to find a viable workaround. I haven’t had a chance to fully test it but have you tried switching to Post Object or removing any logic from fields?
Hey guys
Thanks for the bug report. This issue has been fixed on the github version:
https://github.com/elliotcondon/acf
Cheers
E
Thanks for the quick response Elliot! I replaced the relationship.php file and it seems like whenever I try adjusting the custom field in the ACF editor the new post_type I’m targeting still doesn’t update.
Yes, thanks for the rapid response, Elliot!
In my case, I copied the entire ACF-master folder from github to my plugins directory and renamed it Advanced-Custom-Fields. Following that, the post type for the selected related posts DOES get saved correctly now (instead of changing to the post type of the containing post). However, on the front end I still see no data drawn from the related posts.
You can see the problem here on our test site: http://23.21.199.240/videos
The top 5 items (at this writing) in the main listing on our test page show the bug, where the two people’s names are missing from each item. Further down in the list, older posts saved with an old version of ACF (3.1.0) do not have this problem. But whenever I update a post, or create an entirely new one, the bug occurs.
Anyone else seeing something similar?
I think Elliot is still working on this. BTW, there is another support thread here on the same issue: http://support.advancedcustomfields.com/forums/topic/relationship-field-post-types-not-displaying-correctly/
I believe this has already been fixed:
https://github.com/elliotcondon/acf/commit/686eba9290c7133f492fbc3bc318e4c50804a2a5
Though I’m not sure in which version this would be present.
Did Elliot stop tagging the versions on Github?
I currently have 4.3.8 installed but Github only goes up to 4.3.5
The topic ‘Relationship field loses post type after save’ is closed to new replies.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.