Home › Forums › General Issues › Bidirectional Relationships not updating both sides › Reply To: Bidirectional Relationships not updating both sides
Ok so doing a search for the field name within my database i get the following values:
Before my update:
post_id 16095 (Vacancy): a:1:{i:0;s:5:”12729″;}
post_id 15540 (Research Group): a:1:{i:0;s:5:”15551″;}
After updating the Vacancy relationship field:
post_id 16095 (Vacancy): a:2:{i:0;s:5:”12729″;i:1;s:5:”15540″;}
post_id 15540 (Research Group): a:2:{i:0;s:5:”15551″;i:1;s:5:”16095″;}
At this point my field var_export() on the frontend of my research group shows a blank array.
After resaving the research group side of relationship (in order to fix the frontend output, I changed nothing on the page, just hit update):
post_id 15540 (Research Group) I have: a:2:{i:0;s:5:”15551″;i:1;s:5:”16095″;}
So from this I can see that my ids have updated to include each other within the database correctly after my initial update and after updating again this changed nothing in the DB.
So this brings me towards the conclusion of possibly something front end rather than backend causing the issue?
Why would my var_export() return as blank when the values are saved correctly within the DB after the first update. And why would this issue be fixed when i resave the opposite side of the relationship without changing anything
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.