diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index 2d79826..dd2d0bc 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -696,11 +696,7 @@ public function reset() { $this->runtimeRegistry->clear(); } - // Reset the registry if existent. - if (isset($this->registry) && $this->registry instanceof ThemeRegistry) { - $this->registry->clear(); - } - + $this->runtimeRegistry = NULL; $this->registry = NULL; $this->cache->invalidateTags(array('theme_registry' => TRUE)); return $this; diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php index 347b1ca..2ca9948 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php @@ -71,7 +71,7 @@ function testThemeSuggestions() { */ function testPreprocessForSuggestions() { // Test with both an unprimed and primed theme registry. - Drupal::service('theme.registry')->reset(); + $this->container->get('theme.registry')->reset(); for ($i = 0; $i < 2; $i++) { $this->drupalGet('theme-test/suggestion'); $this->assertText('Theme hook implementor=test_theme_theme_test__suggestion(). Foo=template_preprocess_theme_test', 'Theme hook suggestion ran with data available from a preprocess function for the base hook.'); @@ -87,7 +87,7 @@ function testPreprocessForSuggestions() { */ function testSuggestionPreprocessForDefaults() { // Test with both an unprimed and primed theme registry. - Drupal::service('theme.registry')->reset(); + $this->container->get('theme.registry')->reset(); for ($i = 0; $i < 2; $i++) { $this->drupalGet('theme-test/preprocess-suggestion'); $this->assertText('Theme hook implementor=test_theme_theme_test_preprocess__suggestion(). Foo=template_preprocess_theme_test_preprocess', 'Theme hook ran with data available from a preprocess function for the suggested hook.');