Skip Navigation

[Resolved] Relationship form not returning to same page after submission

This support ticket is created 4 years, 11 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 8 replies, has 2 voices.

Last updated by alexG-4 4 years ago.

Assisted by: Waqar.

Author
Posts
#1244137

I have multiple relationship forms on a page. After I add a relationship, the wrong page gets displayed - as shown in this video.

hidden link

When I place the form on its own on a normal WP page, it works fine, and the page gets re-displayed after I add the relationship.

My situation is that I'm showing the form(s) within a view within another view, both of which are over repeating field groups. The page being shown after I submit the form shows the slug of the repeating field group of the view that displays the form.

I've updated to the latest Toolset plugin versions.

Alex

#1244393

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Thank you for contacting us and I'll be happy to assist.

From your video, I understand that nested repeating field groups are set up to control the sections and sub-sections of the page.

Can you please share temporary admin login details, so that I can see exactly how these repeating field groups, views, and the relationship forms are configured? This way I'll be in a better position to test and reproduce the issue on my own website.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1244937

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Thank you for sharing the admin access and clear context for troubleshooting.

I'll be performing some tests with a similar setup on my own website and will share my findings, as soon as, they are completed.

Thank you for your patience.

regards,
Waqar

#1245094

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Thank you for waiting.

During troubleshooting, I was able to reproduce this issue on my test website. When a relationship form is used inside a view's loop item and is also set to keep the visitor on the same page after submission, the URL of the current post in the view is used (instead of the URL of the page with the view).

Appreciate you brought this forward and I've shared these findings with the concerned team for further review. I'll keep you updated with the progress through this ticket.

For now, you can include some custom script in the relationship form, to replace the redirection URL value with the current page's URL, for example:


jQuery(document).ready(function() {
  
	jQuery('.cred_rel_form_class #cred_redirect_url').val(window.location);
 
});

Note: If a page has multiple relationship forms, including this script in any one of them, should work for all others. Likewise, if you'd like to restrict this script to work on only selective forms on the page, please update the scope of the selector ( .cred_rel_form_class #cred_redirect_url ) accordingly.

regards,
Waqar

#1245144

Thanks for confirming, Waqar.

Glad that the patch is nice and simple!

Regards

Alex

#1245578

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Happy to help and will keep you updated with the progress on this.

regards,
Waqar

#1249287

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

Just wanted to share that we've published a public erratum entry for this issue:
https://toolset.com/errata/relationships-forms-in-a-views-loop-redirect-to-the-current-post-in-the-loop-when-submitted-with-ajax-and-stay-on-the-same-page-is-used/

Will keep you updated.

regards,
Waqar

#1580445

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Alex,

I'd like to update that a fix for this issue is included in the latest release of Forms (2.5.6).

Thank you very much for reporting it.

regards,
Waqar

#1581147

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.