Problem/Motivation

A page layout applies whatever the active theme is.
A layout built with the components of one theme takes over the pages of another, with markup and CSS the other theme never planned for.
This matters once a theme ships a default page layout: it stays live after the site switches to another default theme, or on routes that negotiate another theme.

Steps to reproduce

  1. With UI Suite Bootstrap as default theme, enable Display Builder page layout and build the default page layout with its components.
  2. Install Olivero and set it as default theme.
  3. Visit /user/login: the page shows the UI Suite Bootstrap navbar and grid inside Olivero.

Proposed resolution

In AccessControlHandler::checkAccess(), deny a layout when none of its theme dependencies is the active theme or one of its base themes, with the theme cache context.
A layout built from module components keeps applying everywhere, a sub-theme keeps its base theme's layouts, and a layout using components of two themes applies on both.

Remaining tasks

  • Review.

User interface changes

None.

API changes

The AccessControlHandler constructor takes the theme manager as a fifth argument.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

  • mogtofu33 committed aa8b917d on 1.0.x
    fix: #3632192 A page layout applies on every theme, including one whose...
mogtofu33’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)