Problem/Motivation

Follow-ups from a review of how the submodules touch the theme registry, after #3631924: Views and the page_layout source invalidate the runtime theme registry cache.
The views suggestion alter claims to run last but has no order, so a later module alter can still add a winning suggestion.
Two deliberate choices carry no comment, which invites a well-meant "fix": the render-free window around the theme switch in BuilderDataConverter::convertPage(), and the fixed preprocess list of the entity __display_builder registry entries.

Proposed resolution

Add order: Order::Last to #[Hook('theme_suggestions_views_view_alter')], as TemplateOverride::suggestionsAlter() already does.
In convertPage(), say nothing may render or collect assets between the two setActiveTheme() calls: LibraryDiscoveryCollector memoizes its cache ID from the active theme on first use.
In TemplateOverride::themeRegistryAlter(), say the entity type and module or theme preprocess hooks are skipped on purpose, and what is lost: attributes, contextual links and libraries added there.

Remaining tasks

  • Apply the three changes.
  • Check DisplayExtenderTest stays green.

User interface changes

None.

API changes

None.

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 8f8acb47 on 1.0.x
    fix: #3631942 Order the views suggestion alter last and document two...
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)