Verified Commit 3fc595ad authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3269154 by longwave: Remove BC layers from the theme system

parent f88b4a9a
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ class HtmlRenderer implements MainContentRendererInterface {
   * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
   *   The theme manager.
   */
  public function __construct(TitleResolverInterface $title_resolver, PluginManagerInterface $display_variant_manager, EventDispatcherInterface $event_dispatcher, ModuleHandlerInterface $module_handler, RendererInterface $renderer, RenderCacheInterface $render_cache, array $renderer_config, ThemeManagerInterface $theme_manager = NULL) {
  public function __construct(TitleResolverInterface $title_resolver, PluginManagerInterface $display_variant_manager, EventDispatcherInterface $event_dispatcher, ModuleHandlerInterface $module_handler, RendererInterface $renderer, RenderCacheInterface $render_cache, array $renderer_config, ThemeManagerInterface $theme_manager) {
    $this->titleResolver = $title_resolver;
    $this->displayVariantManager = $display_variant_manager;
    $this->eventDispatcher = $event_dispatcher;
@@ -116,10 +116,6 @@ public function __construct(TitleResolverInterface $title_resolver, PluginManage
    $this->renderer = $renderer;
    $this->renderCache = $render_cache;
    $this->rendererConfig = $renderer_config;
    if ($theme_manager === NULL) {
      @trigger_error('Calling ' . __METHOD__ . ' without the $theme_manager argument is deprecated in drupal:9.1.0 and will be required in drupal:10.0.0. See https://www.drupal.org/node/3159762', E_USER_DEPRECATED);
      $theme_manager = \Drupal::service('theme.manager');
    }
    $this->themeManager = $theme_manager;
  }

+0 −18
Original line number Diff line number Diff line
@@ -812,22 +812,4 @@ public function getPrefixGroupedUserFunctions($prefixes = []) {
    return $grouped_functions;
  }

  /**
   * Wraps drupal_get_path().
   *
   * @param string $module
   *   The name of the item for which the path is requested.
   *
   * @return string
   *
   * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use
   *   \Drupal\Core\Extension\ExtensionList::getPath() instead.
   *
   * @see https://www.drupal.org/node/2940438
   */
  protected function getPath($module) {
    @trigger_error(__METHOD__ . ' is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionList::getPath() instead. See https://www.drupal.org/node/2940438', E_USER_DEPRECATED);
    return $this->moduleList->getPath($module);
  }

}
+3 −13
Original line number Diff line number Diff line
@@ -138,21 +138,11 @@ public function loadActiveTheme(ActiveTheme $active_theme) {
    if ($theme_engine = $active_theme->getEngine()) {
      // Include the engine.
      include_once $this->root . '/' . $active_theme->getOwner();

      if (function_exists($theme_engine . '_init')) {
        @trigger_error('THEME_ENGINE_init() is deprecated in drupal:9.3.0 and removed in drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3246978', E_USER_DEPRECATED);
        foreach ($active_theme->getBaseThemeExtensions() as $base) {
          call_user_func($theme_engine . '_init', $base);
        }
        call_user_func($theme_engine . '_init', $active_theme->getExtension());
      }
      else {
      foreach ($active_theme->getBaseThemeExtensions() as $base) {
        $base->load();
      }
      $active_theme->getExtension()->load();
    }
    }
    else {
      // include non-engine theme files
      foreach ($active_theme->getBaseThemeExtensions() as $base) {
+0 −7
Original line number Diff line number Diff line
@@ -30,15 +30,8 @@ protected function setUp(): void {

  /**
   * Ensures a theme's template is overridable based on the 'template' filename.
   *
   * @group legacy
   *
   * @todo https://www.drupal.org/project/drupal/issues/3246981 Remove
   *   nyan_cat_init() and the legacy group and expected deprecation from this
   *   test.
   */
  public function testTemplateOverride() {
    $this->expectDeprecation('THEME_ENGINE_init() is deprecated in drupal:9.3.0 and removed in drupal:10.0.0. There is no replacement. See https://www.drupal.org/node/3246978');
    $this->config('system.theme')
      ->set('default', 'test_theme_nyan_cat_engine')
      ->save();
+0 −10
Original line number Diff line number Diff line
@@ -7,16 +7,6 @@

use Drupal\Core\Extension\Extension;

/**
 * Includes .theme file from themes.
 *
 * @param \Drupal\Core\Extension\Extension $theme
 *   The theme extension object.
 */
function nyan_cat_init(Extension $theme) {
  $theme->load();
}

/**
 * Implements hook_theme().
 */
Loading