Skip Navigation

[Résolu] Repeating fields should not be used in child posts

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
Showing alert message "Repeating fields should not be used in child posts"

Solution:
You should not use repeating fields while add/edit the post within the post relationship box.

You can find proposed solution in this case, with the following reply:
=> https://toolset.com/forums/topic/repeating-fields-should-not-be-used-in-child-posts-5/#post-627708

Relevant Documentation:

This support ticket is created Il y a 6 années et 8 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Ce sujet contient 11 réponses, a 2 voix.

Dernière mise à jour par Ljuba Il y a 6 années et 8 mois.

Assisté par: Minesh.

Auteur
Publications
#626744

My ticket is already closed but it looks that I get wrong answer. Today I observer your real estate demo and it looks that 'repeating' fields can be used in child posts, but not directly. If I understand well, if I will create Fields Group, such group can contain repeating fields. Than if in next step I assign that Field Group to Child Post, it looks that it is possible to get 'repeating fields in child posts' but not directly inserted n post.

Is it right or not?

#626833

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can not use repeating field with edit post which lists child posts within the post relationship box I think you are confuse where you can use repeating fields.

As I tried to explain you before - Toolset manages repeating field as a child post type.

For instance:
- post type A - parent
- post type B - child (it will be treated as repeating field)

Please check following Doc how CRED manages the child post form:
=> https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

#627006

Well, that's not what I asked. I ask that primary because of media (images for gallery).

1) First (previous, initial) attempt was to add such repeating field to post directly and I get warning as it was child post.

2) Yesterday (after I saw demo), I created media Field Group and assigned group to same child (and other) post types (parent) and I didn't get any warning.

It is confusing now (for me) and I asked explanation of that.

a) Can it working as it is done now (as on real estate demo) or will be some problems?
b) What is the logic of such behavior (question for understanding it for future)?

#627198

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

1) First (previous, initial) attempt was to add such repeating field to post directly and I get warning as it was child post.
==> Yes - as explain you before its not supported within the post relationship box when you add/edit the post.

a) Can it working as it is done now (as on real estate demo) or will be some problems?
==> Where you find in real estate demo. Could you please share link so I can check whats exactly you are point out.

b) What is the logic of such behavior (question for understanding it for future)?
==> I will be able to explain you more after you share above details.

#627370
screenshot-realestate-03.png
screenshot-realestate-02-1.png
screenshot-realestate-02.png
screenshot-realestate-01.png

OK, 3 (and one plus) screenshots from Toolset Real Estate Demo Site.

1) First show that Property Media Field Group belongs to Houses post type (solution what I searching for).
2) Second (and second - 1) show that Property Media Field Group contain REPEATER FIELD with name Property gallery image (exactly what I need).
3) Third show that Houses are CHILD POST TYPE of Agent (I don't have, for now) and City (I have exactly that).

#627378

I must to notice that I see as PRIMARY REASON to create Property Media Field Group, simple fact that it is assigned to four post types and not to avoid issue with repeater field!!!

However, I cannot understand functional and logical difference in solution to get repeater field in independently created Field Group assigned to post and Field Group created directly within the post (but such created repeater field is not allowed???).

#627452

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Ok - so the screenshots you shared is fine.

I you read my last reply as well - I'm talking about "post relationship box" - if you see the image you shared here:
=> lien caché

You will see at bottom of the page - post relationship metabox - That is the place where you got the message before that you should not use repeating fields. You reported ticket before for that and I tried to explain that. Its not allowed within post relationship box. So I hope now you understand that repeating field is not allowed under post relationship box. .

Also - with CRED form - lets consider X is parent and Y is child post type.
- You are on X (parent post type) post page where you have added CRED child form of X post type. In this situation as you are creating child entry - at this Y child form you are not allowed to use repeating field as you are already creating child post.

#627566

OK, it looks as big misunderstanding, but however, I'm now just more and more confused.

For me sounds 'normal' to try form on back-end and I was faced with error massage. However, 'normal' scenario is to use forms from front-end (CRED) where post relationship box will not appear and I'm not clear at all (after your last post)

- can I use it or not?

Actually, I cannot understand how I can met your scenario (X and Y) at all.

As far as I understand, parent posts are useful for hierarchically pulling some data (what I'm doing and what I can also see in demos).

1) So, I have Regions, Provinces, Parishes (City) and finally - Sites (as physical locations). All parent posts are with all fields pre-populated in advance by administrator (mainly - who belongs to who) and users cannot change any of those data when they create the Sites.
2) Under same hierarchy I have also Places (business) to belongs to Parish (City). Form also should be Front-end in CRED.

FINAL (real scenario)

A) I have repeating fields in parent post - Parish (City) - ie, Images for gallery (as in real estate demo) - 'pulled' from Media Field Group.
B) I have in both child posts (Sites and Places), same repeater field - ie, Images for gallery (as in real estate demo) - 'pulled' from Media Field Group.

Is it problem or not (if it is, what, why, how to solve it....)?

#627578

To be more precise, there is also multi relation, as it is possible that for example, we have - Surf school on XXX Beach in ZZZ city (parish) and all 3 posts should to use same Media Field Group with repeaterfields for gallery images.

#627579

Sorry, to avoid unclear thinks.

- Surf school (Place child post of City)
- XXX Beach (Site child post of City)
- ZZZ city (parish) is parent post of both

#627708

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Well - basically, there are two things.

Lets make this simple:
- repeating fields - Yes- You can use it with CRED forms but not within the post relationship table (as post relationship table is treated as repeating field group)
- repeating fields groups - You can not use repeating field within repeating field groups (just like post relationship table)

More info:
=> https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/
As you see the repeating field group - is itself a child post.

I hope all clear now.

#627785

1) Part of the link "Creating a Container Post Type for Repeating Fields" was very useful and thanks for it.
2) I think that I get it, if we count that I simply just should to think that I can use in each part of the 'chain' only one 'repeater' (field or group/container), in not - I hope that Toolset itself will indicate miss-functionality of my construction.