Hi,
I'm using ubercart and pathauto (not sure is related to pathauto) with the following configuration :
Pathauto :
/user path is changed with pathauto.
Ubercart
Checkout disabled for anonymous user.
How to trigger bug :
Add a product in your cart as an anonymous user, try to go to checkout and get error : "This page isn’t working, website redirected you too many times.".
Fix :
In uc_cart/src/Controller/CheckoutController.php :
// Send anonymous users to login page when anonymous checkout is disabled.
if ($this->currentUser()->isAnonymous() && !$cart_config->get('checkout_anonymous')) {
drupal_set_message($this->t('You must login before you can proceed to checkout.'));
if ($this->config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
drupal_set_message($this->t('If you do not have an account yet, you should <a href=":url">register now</a>.', [':url' => Url::fromRoute('user.register', [], ['query' => drupal_get_destination()])->toString()]));
}
// Change user.page to user.login
return $this->redirect('user.login', [], ['query' => drupal_get_destination()]);
}
Comments
Comment #2
aporieComment #3
tr commentedIsn't this the same as #2789977: Wrong redirect path for disabled anonymous checkout? It seems to me that the only difference is that you think this may be caused by renaming the path using pathauto, whereas in that other issue no-one supplied instructions for reproducing the problem.
Comment #4
aporieYes it is actually the same.