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

Redirect target to static route can't use the route name #285

Open
fidelio314 opened this issue May 30, 2019 · 0 comments
Open

Redirect target to static route can't use the route name #285

fidelio314 opened this issue May 30, 2019 · 0 comments

Comments

@fidelio314
Copy link

Hello, i noticed in that the feedback redirect target parameter we can add only a url or an path.
Though if we have a multilingual website it is problematic.

for example on the config: boltforms.bolt.yml

...

    feedback:
        success: form.pionners.success_msg
        error: form.pionners.error_msg
        redirect:
            target: /mypath  # A page path, or URL
            query: [ email, code ]     # Optional keys for the GET parameters

for a my rooting config:


myroute:
     path: /mypath
     defaults:
         _controller: controller.frontend:template
         template: mytemplate

thought: /mypath with not work.

because i have actually these urls:

  • /fr/mypath
  • /en/mypath

this will work:

    feedback:
        success: form.pionners.success_msg
        error: form.pionners.error_msg
        redirect:
            target: /fr/mypath  # A page path, or URL
            query: [ email, code ]     # Optional keys for the GET parameters

it is impossible to add the route name.
this will not work:

target: myroute

because the RedirectableUrlMatcher is used into these files:

extensions/vendor/bolt/boltforms/src/Submission/Handler/Redirect.php
on the function: getRedirectResponse

does anyone have a way to make it work?

otherwise, what do you think it could be the best way to make it work?

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

1 participant