Custom Error Pages On Admin Routes Display with the Admin Theme

Created on 19 November 2024, about 1 month ago

Problem/Motivation

Since Drupal 10.1, custom error pages on a admin path (/admin/*) are shown with the admin theme instead of the custom theme / non-admin theme. This is for users that have some level of access to the admin pages, but not access to the specific page they are trying to get to.

I have also seen this issue in Drupal 10.2 and 10.3.

This screenshot is of the custom error page for a content editor who is trying to access /admin/reports/status, in 10.0:

This screenshot is of the custom error page for a content editor who is trying to access /admin/reports/status, in version 10.1:

This means that the content of the custom error page is not displayed as intended, because the custom error page would have been made with the expectation that it would display using the custom theme / non-admin theme.

I could not find a change recorded that I thought would cause this, so I wonder if it is an unintended change.

Steps to reproduce

  1. Create a node that you want to set as a custom error page
  2. Navigate to /admin/config/system/site-information, and set the error page path to the node you created
  3. As a 'Content editor' (this is a default Drupal user role), or another user with access to admin pages, navigate to a page that the user does not have access to

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.3

Component

theme system

Created by

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

Comments & Activities

Production build 0.71.5 2024