Active
Project:
Drupal core
Version:
main
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2026 at 06:17 UTC
Updated:
10 Apr 2026 at 08:49 UTC
Jump to comment: Most recent
Spin-off from #2538970: Improve the speed of \Drupal\Core\Theme\ThemeAccessCheck
Theme negotiation checks 'access' to a theme, which is actually whether it is installed or not.
When looking at this, I wondered why it would be necessary to check there - shouldn't theme negotiators be responsible for returning a viable theme in the first place?
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 #3
catchOK so we do have test coverage of this - it deliberately returns a fake theme from a theme negotiator.
I'd be tempted to do the following:
1. Trigger a deprecation when a negotiated theme isn't installed, or maybe put the logic in an assert()?
2. In a later release remove the access check altogether and document that theme negotiators are responsible for returning a valid theme.
Comment #4
longwaveI think we could just put the logic in an assert and be done. Or even just throw an exception now? The use case of negotiating an invalid theme and expecting it to work in some way doesn't make sense to me.