Check if site is in maintenance mode before checking if user has access to maintenance mode

Created on 31 July 2025, about 1 month ago

Problem/Motivation

\Drupal\redirect\RedirectChecker::canRedirect checks the user permission to see if they can access maintenance mode even if the site is not in maintenance mode. This triggers the access policy processor. We can avoid this by adjusting the logic to first see if the site is in maintenance mode and avoid permission checks.

Steps to reproduce

Proposed resolution

Flip the logic so ($this->state->get('system.maintenance_mode') || defined('MAINTENANCE_MODE')) is evaluated first.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024