Alternative frontpage settings causes an endless redirect loop

Created on 24 February 2023, over 1 year ago
Updated 14 March 2023, over 1 year ago

Problem/Motivation

When using the alternative_frontpage module, users can create endless redirect loops if they use path aliases for path instead of actual url.

Steps to reproduce

1. Install alternative_frontpage module
2. Create a basic page, that will be the frontpage for authenticated users (eq, /node/1), make sure it has an alias (eq. /front)
3. Set the frontpage to '/node/1' at /admin/config/system/site-information
4. Go to /admin/config/alternative_frontpage
5. Create a new alternative frontpage item for authenticated users
6. For 'Frontpage path' use the alias for the node previously created, eq. /front
7. Save
8. Try to login and access the homepage as authenticated user.
9. Endless redirect loop will occur.

Proposed resolution

In RedirectHomepageSubscriber.php we are not checking if the frontpage path setting is an alias or an actual url. We need to always compare urls and not aliases and then decide if we need to do the redirect.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

11.8

Component

Code (back-end)

Created by

🇸🇮Slovenia nkoporec Slovenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024