Skip Navigation

[Resolved] Solution for not using repeating fields should not be used in child posts

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by michaelO-8 4 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1487489
Before page update.PNG
After page update.PNG

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

#1488147

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

#1488869
Migrate to new post relationships.PNG

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.

#1490215

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

#1496947

My issue is resolved now. Thank you!