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
- With UI Suite Bootstrap as default theme, enable Display Builder page layout and build the default page layout with its components.
- Install Olivero and set it as default theme.
- 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.
Issue fork display_builder-3632192
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
Comment #4
mogtofu33 commentedComment #6
pdureau commented