diff --git a/core/core.services.yml b/core/core.services.yml index 9c3f606..19967f6 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -25,7 +25,7 @@ services: - { name: cache.context} cache_context.theme: class: Drupal\Core\Cache\ThemeCacheContext - arguments: ['@current_route_match', '@theme.negotiator'] + arguments: ['@theme.manager'] tags: - { name: cache.context} cache_context.timezone: diff --git a/core/lib/Drupal/Core/Cache/ThemeCacheContext.php b/core/lib/Drupal/Core/Cache/ThemeCacheContext.php index be2c1e9..ad0249a 100644 --- a/core/lib/Drupal/Core/Cache/ThemeCacheContext.php +++ b/core/lib/Drupal/Core/Cache/ThemeCacheContext.php @@ -16,13 +16,6 @@ class ThemeCacheContext implements CacheContextInterface { /** - * The current route match. - * - * @var \Drupal\Core\Routing\RouteMatch - */ - protected $routeMatch; - - /** * The theme manager. * * @var \Drupal\Core\Theme\ThemeManagerInterface @@ -32,13 +25,10 @@ class ThemeCacheContext implements CacheContextInterface { /** * Constructs a new ThemeCacheContext service. * - * @param \Drupal\Core\Routing\RouteMatchInterface $route_match - * The route match. * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager * The theme manager. */ - public function __construct(RouteMatchInterface $route_match, ThemeManagerInterface $theme_manager) { - $this->routeMatch = $route_match; + public function __construct(ThemeManagerInterface $theme_manager) { $this->themeManager = $theme_manager; } diff --git a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php index 0084435..50eb373 100644 --- a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php +++ b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php @@ -11,7 +11,6 @@ use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Theme\ThemeManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;