Commit 8184e399 authored by catch's avatar catch
Browse files

Issue #3348851 by andypost: Deprecate drupal_theme_rebuild()

parent 0687f85d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -118,8 +118,14 @@ function _system_default_theme_features() {
 *
 * This function should be called when modules are added to the system, or when
 * a dynamic system needs to add more theme hooks.
 *
 * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
 *   theme.registry service reset() method instead.
 *
 * @see https://www.drupal.org/node/3348853
 */
function drupal_theme_rebuild() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use theme.registry service reset() method instead. See https://www.drupal.org/node/3348853', E_USER_DEPRECATED);
  \Drupal::service('theme.registry')->reset();
}

+2 −2
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
        \Drupal::service('stream_wrapper_manager')->register();

        // Update the theme registry to include it.
        drupal_theme_rebuild();
        \Drupal::service('theme.registry')->reset();

        // Modules can alter theme info, so refresh theme data.
        // @todo ThemeHandler cannot be injected into ModuleHandler, since that
@@ -517,7 +517,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
      \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions();

      // Update the theme registry to remove the newly uninstalled module.
      drupal_theme_rebuild();
      \Drupal::service('theme.registry')->reset();

      // Modules can alter theme info, so refresh theme data.
      // @todo ThemeHandler cannot be injected into ModuleHandler, since that
+1 −8
Original line number Diff line number Diff line
@@ -307,14 +307,7 @@ protected function resetSystem() {
    // @todo It feels wrong to have the requirement to clear the local tasks
    //   cache here.
    Cache::invalidateTags(['local_task']);
    $this->themeRegistryRebuild();
  }

  /**
   * Wraps drupal_theme_rebuild().
   */
  protected function themeRegistryRebuild() {
    drupal_theme_rebuild();
    \Drupal::service('theme.registry')->reset();
  }

}
+1 −1
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ public function flush($path = NULL) {
    $module_handler->invokeAll('image_style_flush', [$this]);

    // Clear caches so that formatters may be added for this style.
    drupal_theme_rebuild();
    \Drupal::service('theme.registry')->reset();

    Cache::invalidateTags($this->getCacheTagsToInvalidate());

+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public function onRequest(RequestEvent $event) {
      // First, force the theme registry to be rebuilt on this page request.
      // This allows us to test a full initialization of the theme system in
      // the code below.
      drupal_theme_rebuild();
      \Drupal::service('theme.registry')->reset();
      // Next, initialize the theme system by storing themed text in a global
      // variable. We will use this later in
      // theme_test_request_listener_page_callback() to test that even when the
Loading