The redirect
return $this->redirect('user.page', [], ['query' => drupal_get_destination()]);
in ubercart/uc_cart/src/Controller/CheckoutController.php on line 85 results in multiple redirections.

The correct redirect is
return $this->redirect('user.register', [], ['query' => drupal_get_destination()]);

Comments

mathiasgmeiner created an issue. See original summary.

mathiasgmeiner’s picture

Issue summary: View changes
TR’s picture

Category: Bug report » Task
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

Anonymous users can be either users who are not logged in or they can be users who do not have an account on the site yet. user.register is the tab for creating new accounts, and we don't want that as the landing page for the redirect. Better would be user.login.

user.page, which we use now, is less specific than user.login but it does bring you to the same page.

mathiasgmeiner’s picture

But if the user is not logged in, this path results in multiple redirects and the browsers (Firefox in my case) throw an error.

TR’s picture

Status: Postponed (maintainer needs more info) » Active

Sorry I wasn't clear - I didn't mean we won't change it, but it really shouldn't be causing errors for you right now as it is - a redirect isn't really problem. user.page (/user) is always a valid route and should always bring you to the same page as user.login (/user/login) for an anonymous user. Throwing errors IS a problem, but I can't reproduce that in Firefox or Chrome - perhaps you're using some contributed module like logintoboggan that modifies the log in process?

mathiasgmeiner’s picture

Thanks for the clarification!

I have Email Registration installed, but uninstallation doesn't change the behaviour of the redirects.

With Email Registration:
Screencast #1

With Email Registration:
Screencast #2

It is the same thing in Chrome and Safari.

But you are absolutely right that user.login instead of user.register, it's way more user friendly!

TR’s picture

What happens if you try to visit /user on your site while you are anonymous?

mathiasgmeiner’s picture

Just /user is ok, everything is fine. But with /user?destination=/cart/checkout the multiple redirects happen.

keshav.k’s picture

Assigned: Unassigned » keshav.k
Status: Active » Needs review
FileSize
923 bytes

Same problem is happened.
When checkout as anonymous . the page isn't redirect to login. I will test it when url is "/user" , then working fine .
but when the url is with query string 'base_url/user?destination=/root/cart/checkout' then it will not working . and URL like 'base_url/user/login?destination=/root/cart/checkout' will working fine.
So i think changing in ubercart/uc_cart/src/Controller/CheckoutController.php on line 85 results in multiple redirections.
return $this->redirect('user.register', [], ['query' => drupal_get_destination()]);
Will be Great!

keshav.k’s picture

Status: Needs review » Needs work

The last submitted patch, 9: redirect_2789977_1.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 11: redirect_2789977_2.patch, failed testing.

keshav.k’s picture

keshav.k’s picture

Status: Needs work » Needs review
FileSize
907 bytes

Status: Needs review » Needs work

The last submitted patch, 15: redirect_2789977_3.patch, failed testing.