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

Issue tags:+Configuration system

tagging

Title:Create a theme handler to manage enabling / disabling of themesCreate Drupal::themeHandler() to manage common tasks

We should also probably move the theme related stuff in Drupal::moduleHandler()->alter() to something like Drupal::themeHandler()->alter(). We're also going to need something like Drupal::themeHandler()->invoke() (for active theme only, no invokeAll) for #2035055: Introduce hook_theme_prepare[_alter]() and remove hook_preprocess_HOOK().

Title:Create Drupal::themeHandler() to manage common tasksImplement a ThemeHandler to manage themes (@see ModuleHandler)

Re-titling.

Priority:Major» Normal

As 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. ;)

Issue summary:View changes

...mentioning parent issue #2024083

#2109287: Replace list_themes() with a service. introduces such a theme handler.

Status:Active» Closed (duplicate)

Let's mark it as duplicate.