Tell us what you are trying to do?
I am currently using repeated fields in child posts. For example, in a post form, users can add multiple locations (NY, MO, etc.). Then, on the parent page, these values are displayed. This seems to work fine as long as I don't update the parent page.
However, upon updating the parent page, additional/repeating fields seemed to get deleted. If a user inputted NY and also MO, only the first value, NY, would still be stored and be displayed.
I would like for users to be able to input multiple fields, but it seems like I am not supposed to use repeating fields in this way. I did notice the warning "Repeating fields should not be used in child posts. Types will update all field values." Is there a workaround, best practice or other solution?
What is the link to your site?
Here is a link to a sample page on the test site: hidden link
Hi Michael,
Thank you for contacting us and I'd be happy to assist.
I noticed your website is using the older implementation of the post-relationship feature.
The child post type "Booths" only seems to have one field "Open Positions", which is a repeatable field and you can avoid this warning message and issue, by not loading it, on the edit screen of the parent "Career Fairs" post type.
Please go to the settings of "Career Fairs" post type ( yourwebsite.com/wp-admin/admin.php?page=wpcf-edit-type&wpcf-post-type=fair ) and from the post-relationship section at the bottom, you can enable all but the "Open Positions" field.
Screenshot: hidden link
I hope this helps and please let me know how it goes.
regards,
Waqar
Thank you, this solved my issue! Before I close this, I would like to learn a little bit more about the older implementation of the post-relationship feature vs the newer version.
1. Does the newer implementation handle this situation differently?
2. If I go to "relationships" and click the "run migration" button, will that give me the new implementation?
3. Are there any risks that old data will get corrupted/have issues after the migration? I don't see any downside to running the migration as long as old toolset data will be safe.
Hi Michael,
Thanks for the update and glad that it is resolved.
1. In newer Relationships, the interface offers better control for editing the fields from the related posts, which is why they don't result in the same issue, for the repeating fields.
Example screenshot: hidden link
2 & 3. To better understand how and when the older relationships should or shouldn't be migrated to the new structure, the following guides have useful information and steps:
https://toolset.com/2018/05/when-if-to-migrate-relationships-in-old-toolset-sites/
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/
Please let me know if any point is not clear or you have any follow up questions.
regards,
Waqar
My issue is resolved now. Thank you!