Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic redirectUrl params only work for last page submissions #2290

Open
chrisrowe opened this issue Feb 13, 2025 · 1 comment
Open

Dynamic redirectUrl params only work for last page submissions #2290

chrisrowe opened this issue Feb 13, 2025 · 1 comment

Comments

@chrisrowe
Copy link
Contributor

Describe the bug

If I have a multipage form and the last page is conditionally shown based on earlier inputs then the redirect URL parameters (eg redirectUrl: form.getRedirectEntry.url ~ '?uid={uid}', only get populated and uid parsed if the submission comes from the last page in the form

Steps to reproduce

  1. Create a form with 3 pages
  2. Add option to page 1
  3. Conditionally show page 3 based on page 1 question
  4. If page 3 is never shown {uid} isn't swapped out

Form settings

  • Multi-page form: Yes
  • Submission Method: Page Reload
  • Client-side Validation: Yes
  • Custom Form Templates: No

Craft CMS version

5.6.6

Plugin version

3.0.20

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

This is correct behaviour (for now), mostly because otherwise we evaluate things too early. What if the redirect URL contained field values on the nth page?

More importantly, sometimes you don't want to expose the resolved redirect URL before the form is complete, which would be typical of a gated form, which requires users to fill out a form before discovering the redirect - whatever that may be.

But in your scenario when there's a conditional evaluation involved, it's indeed a little trickier. Looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants