Skip Navigation

[Resolved] Connecting Repeatable Fields Group to parent post

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 14 replies, has 2 voices.

Last updated by lesleyA 2 years ago.

Assisted by: Shane.

Author
Posts
#2331891

Tell us what you are trying to do?
I have a post form which allows a guest to create a post for "Suppliers" set to "pending review". When the form is submitted, the new supplier is redirected to a form which displays a repeatable fields group. My problem is that the parent post is not available in the drop down that has to appear at the bottom of the form.

Is this because of the status of the parent post? What is the best way to deal with this do you think?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2331963
Screen Shot 2022-04-01 at 17.49.14.png

I've been thinking and reading and I imagine that I will need a view on the second post form which relates to "suppliers" post type. Am I on the right track?

However, my selections in the query filter return forms for all the posts in the "suppliers" post type. And still they don't show a parent in the drop down.

Looking forward to reading the answer!

Thank you

Lesley

#2332075

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

The problem that you're having is that your post is set to pending review and not published.

Only posts that have a published status will be able to show here.

So what you can do is set the post to published and then draft after you've finished connect the repeatable field group.

You can change the post status on the backend.

Thanks,
Shane

#2332107

Thank you Shane,

I have altered the status of the parent post, but I've still got something wrong.

Front end the page displays the form inside the view, but still it isn't showing the parent post in the drop down menu.

Your help is very much appreciated.

FIRST FORM
hidden link

REDIRECTS TO
hidden link

#2333461

Dear Shane,

I have made some progress today, but was hoping you might be able to help me figure out how I can change the post status after forms have been submitted. My workflow is as follows

Supplier on-boarding form (post): hidden link
First reference form (post): hidden link
Second reference form (post): hidden link —it would be good if I could change the status of the first post back to draft or pending at this stage
Supplier registration form (user): hidden link

Thanks so much,

Lesley

#2333635

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

Please where applicable please provide me with a link to an example page where I can see the issue.

I've enabled the private fields for your next response.

Thanks,
Shane

#2333671

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

The problem is still that your suppliers are set as drafts.

As soon as I changed one of the statuses from Draft to publish it shows up fine.

IF you check the supplier Bing LTD you will see the status is now set to published and it is appearing as an option in the form to select.

Thanks,
Shane

#2333701
Screen Shot 2022-04-04 at 16.42.43.png

Thanks Shane,

I understand the point, but…

…when a new person goes to the first form here: hidden link
they effectively create a new published post. So it surely shouldn't matter if the other posts are published or not. I need to be able to change all posts to draft for checking purposes.

Then the new supplier (author of the above post) is redirected here: hidden link where they should see the parent post they created belonging to the themselves (current author).

Also, I now have two forms appearing on the page. I've attached an image of this.

#2333719

Shane, is it possible that I have this process completely the wrong way round?

Should I first of all use the User form to create a logged in user which then directs to the supplier on-boarding (post) form and then onto the references (post) form(s)?

#2333779

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

It actually matters internally on status of the posts. Only posts with status that are Published will be publicly available. This means that only the posts that are published will be shown in the parent field even though we know that these posts have already been created.

Yes I agree that it shouldn't matter but it does in this case because a post only gets an author when it is set as published, also whoever publishes that posts becomes the author of the post. This is how wordpress works by default.

Secondly with the multiple forms. This is due to you having the form in a view. I don't see the reason for the view so I suggest removing the view and adding the form directly to the page.

Lastly i've tested the form and it works fine. I created a post and it was set to published when the form was submitted. Then on the RFG form I was able to select my "Test" post as an option.

Should I first of all use the User form to create a logged in user which then directs to the supplier on-boarding (post) form and then onto the references (post) form(s)?

It would be best to have your users have actual accounts on your site as this will allow them to have proper author settings for the supplier relationship field, given that you've set it to display only the posts for the current user.

Thanks,
Shane

#2333787
Screen Shot 2022-04-04 at 19.55.59.png
Screen Shot 2022-04-04 at 19.55.33.png

Hi Shane, thanks indeed.

I don't dispute the first two paragraphs and I have it set so that the post publishes.
I have removed the views – I was trying to make it so that the author only sees their own post in the drop down (what happens if there are hundreds of posts?)

But this is where it all falls apart for me:
"Lastly i've tested the form and it works fine. I created a post and it was set to published when the form was submitted. Then on the RFG form I was able to select my "Test" post as an option."

I have just made two posts and yet when I reach the RFG forms I still don't see anything in the drop down!

#2333831
Screen Shot 2022-04-04 at 20.19.11.png

Shane! Look! The posts I make incognito have no author!!! (see image)

When you made a post (logged in as me) I was assigned as author, which I guess is why you could see "Test" in the dropdown.

I have switched the forms so that a user is made and they are directed to the form. But there's still not an author!

#2333861

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

I was trying to make it so that the author only sees their own post in the drop down (what happens if there are hundreds of posts?)
Setting this on the form field itself is enough. Adding the form to a view has no bearing in what will show up here.

I have just made two posts and yet when I reach the RFG forms I still don't see anything in the drop down!

Can you record the steps that you're doing so that I can see how you're going through ? Also are you logged in as a user ?

Shane! Look! The posts I make incognito have no author!!! (see image)

When you made a post (logged in as me) I was assigned as author, which I guess is why you could see "Test" in the dropdown.

I suppose this answers my previous question about if you're logged in. That's correct, guests aren't users on the site so when they create a post wordpress doesn't know who to assign such post to. This is why I recommend that your users should be logged into actual accounts on your site to make this work properly.

The only other alternative is to not restrict the parent field by authors but this will cause all the posts to show up and the user will need to search the parent drop down for their post name.

Thanks,
Shane

#2334233

Thank you Shane

I think I must've missed the step in the documentation! But I guess it goes without saying that a user needs to be logged in in order to be an author and add to their post! (Sorry for being such a numpty!)

I'm thinking I should follow the advice set out here: https://toolset.com/forums/topic/when-i-create-a-user-it-is-not-kept-logged-in/
It seems to be what I'm looking for. Do you agree?

Lesley

#2334253

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.