#2228093: Modernize theme initialization originally intended to eliminate the magic overloading of theme info properties on Extension objects, but did not.
The magically overloaded theme extension properties are still used:
Undefined property: Drupal\Core\Extension\Extension::$info Drupal\Core\Extension\ThemeHandler->addTheme(Object) Drupal\Core\Extension\ThemeHandler->listInfo() list_themes() _drupal_maintenance_theme() drupal_maintenance_theme() drupal_flush_all_caches()
The reason is:
#2228093: Modernize theme initialization only cleaned up theme initialization.
However, ThemeHandler::rebuildThemeData() is unrelated to initialization and still operates on Extension objects only.
Given that there is a use-case for instantiating a Theme domain object (including base themes) within that process, we should probably rename the ActiveTheme class into just Theme. — No change in behavior. It only doesn't have to be the currently active theme, you can instantiate it for any theme.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | theme_extension-2326407-5.patch | 32.4 KB | dawehner |
| #3 | theme_extension-2326407-3.patch | 20.25 KB | dawehner |
| #2 | ext.overload.2.do-not-test.patch | 1.24 KB | sun |
Comments
Comment #1
sunComment #2
sunAttached patch clarifies the challenge to resolve for this issue.
Comment #3
dawehnerWorked a bit on that, let's see how much fails.
I am not convinced that we can actually drop the getBaseThemes method though I have the feeling that this logic should be actually moved into the theme active factory.
Comment #5
dawehnerSome work.
Comment #13
larowlanSeems we also do this with modules (requires, info, required_by, requires, sort) - see
\Drupal\Core\Extension\ModuleHandler::buildModuleDependenciesComment #14
larowlanLooking at the OP is this still relevant for themes, that code in Extension is gone.
We have something similarly ugly in modules - should we include that in scope here or should I open a new issue?
Comment #15
larowlanAh #2024043: Add Module, Theme, Profile, and Extension value objects is what I'm chasing
Comment #18
fgmToo late for 8.x.
Comment #24
andypostComment #26
nicxvan commentedis deprecated, can we close this?