Needs work
Project:
Drupal core
Version:
main
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2018 at 23:22 UTC
Updated:
24 Mar 2026 at 21:14 UTC
Jump to comment: Most recent
Drupal\Core\Theme\Registry::$registry is an array with this format:
$this->registry[$theme_name][$theme_hook] = $theme_registry_entry
However, Drupal\Core\Theme\Registry::getBaseHook() treats this array as if the array keys were hook names, not theme names.
if (isset($this->registry[$base_hook]['exists'])) {
break;
}
As far as I know (grep), the method is never called anywhere in core.
If it is called in contrib, it won't work correctly.
And in fact, to get the base hook, one would rather want to use the runtime theme registry (Drupal\Core\Utility\ThemeRegistry), not Drupal\Core\Theme\Registry.
Perhaps the best option is to remove this method?
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 #12
smustgrave commentedThis came up as a daily BSI
This still appears to be valid, can't find anywhere getBaseHook is actually called in core.
We should deprecate it properly.
Also tagged for summary update to use standard template.
Comment #13
sujal kshatri commentedHey , will this work?
Adding a deprecation docblock like :-
And inside the method, this as the first line:
Comment #14
smustgrave commentedClose but in this case there would be no replacement because it's not used. There are several examples in core with the correct verbage. A change record will have to be written for the link.
Comment #15
sujal kshatri commentedThanks, Okay then I'll look at some examples and also write a change record
Comment #16
sujal kshatri commentedHave a look at this - https://www.drupal.org/node/3567793
Comment #17
sujal kshatri commentedI looked at some of the examples and came up with this.
Final would look something like this:-
And inside the method, this as the first line:
My doubt is wether i should write
@deprecated in drupal:11.0.0 and is removed from drupal:12.0.0.or@deprecated in drupal:11.0.0 and will be removed from drupal:12.0.0.?Comment #19
sujal kshatri commentedComment #20
smustgrave commentedI don't see an MR but that message is incorrect too. Check other deprecations in core examples. This would be deprecated in 11.4 and removed in 12
Comment #21
sujal kshatri commentedI wanted to confirm whether that message was correct or not before making the MR, thanks for the feedback i'll look at other core deprecations and make changes to mine
Comment #23
sujal kshatri commentedComment #24
nicxvan commentedA couple suggestions on the MR.
Will be is correct.
I think removal in 12 is fine since it's not used.
I'll do a quick search too.
Edit, I couldn't find any instances in contrib.
Comment #25
dcam commentedThis issue was tagged for needing an update to the issue summary. The standard issue summary template should be applied. All of the standard headings should be added, even if they have no content or "N/A" under them.
For that reason and @nicxvan's suggestions I'm setting the issue status to Needs Work.
Comment #26
quietone commentedThe change record for this issue was published. Since this hasn't been committed I have returned it to a draft.
Comment #28
dany.almeida.kairouzThe Drupal Contribution Mentoring team is triaging issues for DrupalCon Chicago 2026, and we are reserving this issue for Mentored Contribution during the event.
After Thursday 26th March 2026 + 1 DAY (13:00 UTC), this issue returns to being open to all. Thanks!
Comment #29
mradcliffeFixing the tag.