Skip Navigation

[Resolved] CRED form redirects failing and also renaming themselves

This support ticket is created 7 years 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by robertM-17 7 years ago.

Assisted by: Nigel.

Author
Posts
#589087

I am trying to:

Get CRED form to redirect. But encountering problems. ...

1) tried the 'What happens after submit' : various things tried

a) firstly - I want to redirect to page that would show what's just created AND have form for adding related content to parent/child/sibling CPTS.
So I would like to use hook to get content created by the fist form to be associated with the next form / page/ post / content that is redirected to.

I been following Beda's advice on hooks. having a problem here with my understanding but also new problems. https://toolset.com/forums/topic/passing-new-cpt-idslug-to-another-form/
I set up a cred_success_redirect hook in GP child theme but not working. So I've commented this out now and gone back to GP original to test.

b) For testing form further - I tried Edit Post form ... changing 'what happens after submit' action to something else (for testing). I chose display a message' but then the form somehow RENAMES ITSELF. The first from renamed itself to SAMPLE PAGE, so where it was already embedded in another post it now says form does not exist. Tho the same ID does exist. And the title but the slug has somehow been changed.

I been flushing cache after making changes and saving also to try to see if that helped but it didn't.

Now I have this form with 'sample-page' as it's slug. AND HOW DO YOU CHANGE A CRED FORM SLUG?

2) I made a Clone of the form, placed it in the post I want it. Set the 'what happens after' to display a post (redirect doesn't work) comes back to same page.
Changed to : display a page... (doesn't work) come back to same page.
Changed to: Tried change to 'display a message' - form seems to rename itself again.

So where the form was embedded it says, does not exist - because the slug has changed.

Now I have these two forms, which I see when trying to insert using CRED forms button.
[cred_form form="sample-page"]
[cred_form form="sample-page-2"]

#589092
8 orginal slug not exist - new slug for form now.png
7 forms available.png
6 form no longer exists.png
5 change the what happens after.png
4 the test form to edit.png
3 message works ok.png
2 adding sample data.png
1a form original what happens after settgin.png
1 proper shortcode slug.png

...screenshots

#589111
Screenshot 2017-11-13 12.06.56.png

and finally...
for now...

With the newly-slugged form, the redirect setting does not work.

I have the setting as go to a page (sample page for testing - screenshot)
but on form submission, it just returns to the page the form is on and does not redirect.

#589140

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Robert

Can we start with the basics and establish whether basic forms redirects are working on your site, and then I can help you with your main question.

Make sure that any custom code you have added for modifying form handling has been commented out.

Add a CRED form to publish standard posts and automatically generate the form markup. In the settings have it redirect to some standard page upon submission.

Add the form to a page and make a sample post.

Does it redirect correctly? (You should see the new page load with the URL parameter cred_referrer_form_id added.)

If not, please disable all non-Toolset plugins and switch to a standard theme such as twentyseventeen and try again.

Let me know how you get on and I can see how to proceed.

#589154

Hi Nigel
Thanks for this

That 'old chestnut' (I see you're English so the idiom should work) did work.

I had a 'plugin' which added customisation. When I went back to GP clean, this was still there. However I am not aware of any changes having been made and it was working before - with this plugin. So this threw me. Not sure what problems I've introduced. and at this level it could be a stray or missing ';'. I'll have to spend time debugging. However, very strange set of consequences - rewriting the forms, not redirecting etc.

Thanks again.
I'll consider that resolved. And trying adding back in the other plugins before debugging attempts for those customisation.

Cheers
Robert

#591226

It seems like there were two parts to the problem.
I have opened another ticket
https://toolset.com/forums/topic/cred-form-slug-renaming-themselves-and-overwriting-existing-forms/

as the slug rewriting problem is still giving me 'sample page' and not using the form name for the slug.

Thanks