Problem/Motivation
FullPageBuilderPageVariant and PageLayoutPageVariant swap the page template with $runtime->set('page', ...) on the runtime theme registry, meant for one request.
When the runtime cache is empty, ThemeRegistry::__construct() marks every entry to be saved at the end of the request, and set() keeps that mark.
So the first builder page after a cache rebuild saves the bare {{ page }} template for the admin theme.
Every admin page then renders without the admin theme's page.html.twig.
With Default Admin and Navigation, the breadcrumb shows twice: once in the top bar, once in the breadcrumb region.
The Builder iframe does the same for the front theme.
The first front page also saves the Page Layout region template, and drops the theme's page__ and region__ entries, such as region__no_wrapper in UI Suite Bootstrap.
A cache rebuild fixes the site until the next time.
Steps to reproduce
- Use Default Admin as the admin theme, with Navigation enabled and a page layout.
- Run
drush cr. - As the first request, open
/admin/structure/page-layout/default/builder. - Open
/admin/structure/taxonomy: the admin layout is gone and the breadcrumb shows twice.
Proposed resolution
Declare the bare templates as page suggestions in hook_theme(), and select them with #theme instead of changing the runtime theme registry.
The Page Layout region template goes: a page layout has no theme region to wrap.
Remaining tasks
- Review.
- Follow-up:
PageLayoutSourceand the ViewsDisplayExtenderstill callset()on the runtime registry.page_legacyis never saved, and the Views suggestion is saved only when a theme registers it. Each call still invalidates the theme's runtime cache. - Drop the matching workaround in ui_suite_uikit,
PageTemplateHooks::themeSuggestionsPageAlter().
Issue fork display_builder-3631914
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 #2
mogtofu33 commentedComment #5
mogtofu33 commentedComment #7
pdureau commented