Problem/Motivation
The function has few usages in core and contrib also it extra cost from API maintenance POV, extra function call
Steps to reproduce
git grep drupal_theme_rebuild
core/includes/theme.inc:122:function drupal_theme_rebuild() {
core/lib/Drupal/Core/Extension/ModuleInstaller.php:340: drupal_theme_rebuild();
core/lib/Drupal/Core/Extension/ModuleInstaller.php:520: drupal_theme_rebuild();
core/lib/Drupal/Core/Extension/ThemeInstaller.php:314: * Wraps drupal_theme_rebuild().
core/lib/Drupal/Core/Extension/ThemeInstaller.php:317: drupal_theme_rebuild();
core/modules/image/src/Entity/ImageStyle.php:302: drupal_theme_rebuild();
core/modules/system/tests/modules/theme_test/src/EventSubscriber/ThemeTestSubscriber.php:62: drupal_theme_rebuild();
core/modules/system/tests/src/Functional/Theme/ThemeTest.php:45: drupal_theme_rebuild();
core/modules/system/tests/src/Functional/Theme/ThemeTest.php:181: drupal_theme_rebuild();
Proposed resolution
deprecate and inject theme.registry service where possible
Remaining tasks
- patch/review/commit
User interface changes
no
API changes
drupal_theme_rebuild() deprecated
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3348851-3.patch | 6.57 KB | andypost |
Comments
Comment #2
andypostDeprecation and test
CR https://www.drupal.org/node/3348853
Comment #3
andypostComment #4
andypostComment #5
andypostreplace usage, not sure about removal of protected method as BC but now it needs to try inject registry
Comment #7
andypostComment #8
andypostComment #9
andypostComment #10
daffie commentedAll code changes look good to me.
Deprecation message testing has been added.
The testbot return green.
The IS and the CR are in order.
For me it is RTBC.
Comment #12
andypostre-queued as can't reproduce locally
like sequences table is not installed
Comment #13
andypostComment #14
purencool commentedApplying the 3348851-3 patch produced the following results locally.
Before patch was applied
After patch was applied
PHPUnit test result
Comment #15
catchCommitted 8184e39 and pushed to 10.1.x. Thanks!
Comment #17
catchComment #18
andypostFiled follow-up #3350904: Properly inject the theme registry in the ThemeInstaller