The current implementation gets the ReturnTo parameter from POST (or PUT). It's easier to be able to give it in a GET parameter in the URL, especially when redirecting an anonymous user. I think it was possible in Drupal 7. Here's a patch for this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GaëlG created an issue. See original summary.

George Bills’s picture

In case it's useful - this patch applies cleanly my end, and I've verified that passing ReturnTo in the URL works afterwards.

GaëlG’s picture

Status: Needs review » Reviewed & tested by the community

Thank you George for the review.

dakku’s picture

Thank you guys, this could be a really useful feature.

One question:

The current implementation gets the ReturnTo parameter from POST (or PUT)

Does the POST / PUT functionality still work after this patch?

George Bills’s picture

@dakku - it should but I haven't tested it sorry.

The Symfony doco - https://api.symfony.com/2.7/Symfony/Component/HttpFoundation/Request.html - says:

ParameterBag $request Request body parameters ($_POST).

mixed get(string $key, mixed $default = null, bool $deep = false)

Gets a "parameter" value.

This method is mainly useful for libraries that want to provide some flexibility.

Order of precedence: GET, PATH, POST

Avoid using this method in controllers:

  • slow
  • prefer to get from a "named" source

It is better to explicitly get request parameters from the appropriate public property instead (query, attributes, request).

So "$request" (old) is explicitly POSTed vars only, "get()" (new)" will pull vars from GET, PATH then POST in that order.

  • dakku committed c4dd5db on 8.x-3.x
    Issue #2928293 by GaëlG: /saml_login?ReturnTo=<url> doesn't work
    
dakku’s picture

Thank you for the patch. I revised the patch and tested locally!

dakku’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.