Postponed until 8.1.x
We have a moduleHandler class which is used to assist with enabling / disabling modules. Proposing we have a similar mechanism for themes.
theme_enable()
theme_disable() etc... would be converted so we would end up with
Drupal::themeHandler()->disable($theme_list)
....
This would be useful in #1808248: Add a separate module install/uninstall step to the config import process where we would like to override the default behavior if we are enabling a theme via a config import.
Comments
Comment #1
tayzlor CreditAttribution: tayzlor commentedtagging
Comment #2
catchCross posting: #1067408: Themes do not have an installation status.
Comment #3
markhalliwellWe should also probably move the theme related stuff in
Drupal::moduleHandler()->alter()
to something likeDrupal::themeHandler()->alter()
. We're also going to need something likeDrupal::themeHandler()->invoke()
(for active theme only, no invokeAll) for #2035055: Introduce hook_theme_prepare[_alter]() and remove hook_preprocess_HOOK().Comment #4
markhalliwellSetting this as a major task since it relates to #2004872: [meta] Theme system architecture changes, #1751194: Introduce hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter(), and #2035055: Introduce hook_theme_prepare[_alter]() and remove hook_preprocess_HOOK().
Comment #5
fubhy CreditAttribution: fubhy commentedRe-titling.
Comment #6
webchickAs far as I can see, this is just a nice to have, and part of #2024083: [META] Improve the extension system (modules, profiles, themes) which is only "normal."
I'd also like to remind people that API freeze was over a month ago. ;)
Comment #6.0
klonos...mentioning parent issue #2024083
Comment #7
dawehner#2109287: Replace list_themes() with a service. introduces such a theme handler.
Comment #8
klonosComment #9
dawehnerLet's mark it as duplicate.
Comment #10
markhalliwellNot sure why this was marked as a dup. Yes, #2109287: Replace list_themes() with a service. introduced a theme handler, but this issue is about improving upon all the extension handling (module, theme, profiles) from a base class: #2024083: [META] Improve the extension system (modules, profiles, themes).
Comment #11
filijonka CreditAttribution: filijonka commentedMETA has been postponed to 8.1.x hence this too
Comment #12
star-szrTo follow up on #10 this needs an issue summary update because #2109287: Replace list_themes() with a service. fixes the issue summary (from my perspective anyway).
Comment #13
dawehnerWe have theme enable / disable in the theme handler, maybe even split that up #2465887: Extract the install/uninstall functionality to a ThemeInstaller but it seems to be that the promise of
#2029819-10: Implement a ThemeHandler to manage themes (@see ModuleHandler) would be partially solved by #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList .