Stop discovering theme preprocess twice for theme engine discovered templates

Created on 29 October 2025, 4 days ago

Problem/Motivation

Themes always get an extra chance at the end of \Drupal\Core\Theme\Registry::processExtension() to add preprocess to everything, and then also the extra-extra processing for theme suggestions (which I think we an clean up and combine if we extend the current preprocess-collected data and combine it, but that's for D12).

Theme engines currently also looks for theme prefixed functions, Modules don't do that. This check does not support OOP and it specifically does not support LegacyHook, so it might add preprocess twice. It also doesn't deal with base themes. I think we can just remove that and see if anything breaks.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

theme system

Created by

🇨🇭Switzerland berdir Switzerland

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024