diff -u b/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php --- b/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -236,7 +236,7 @@ public function getRuntime() { $this->init($this->themeName); if (!isset($this->runtimeRegistry)) { - $this->runtimeRegistry = new ThemeRegistry($this->cache, $this->lock, array('theme_registry'), $this->moduleHandler->isLoaded()); + $this->runtimeRegistry = new ThemeRegistry($this->cache, $this->lock, $this->theme, array('theme_registry'), $this->moduleHandler->isLoaded()); } return $this->runtimeRegistry; } diff -u b/core/lib/Drupal/Core/Utility/ThemeRegistry.php b/core/lib/Drupal/Core/Utility/ThemeRegistry.php --- b/core/lib/Drupal/Core/Utility/ThemeRegistry.php +++ b/core/lib/Drupal/Core/Utility/ThemeRegistry.php @@ -12,6 +12,7 @@ use Drupal\Core\Cache\CacheCollector; use Drupal\Core\DestructableInterface; use Drupal\Core\Lock\LockBackendInterface; +use Drupal\Core\Theme\ActiveTheme; /** * Builds the run-time theme registry. @@ -40,7 +41,14 @@ /** * Whether all modules have already been loaded. */ - protected $modules_loaded; + protected $modulesLoaded; + + /** + * The theme object representing the active theme for this registry. + * + * @var \Drupal\Core\Theme\ActiveTheme + */ + protected $theme; /** * Constructs a ThemeRegistry object. @@ -49,16 +57,19 @@ * The cache backend. * @param \Drupal\Core\Lock\LockBackendInterface $lock * The lock backend. + * @param \Drupal\Core\Theme\ActiveTheme $theme + * The theme object representing the active theme for this registry. * @param array $tags * (optional) The tags to specify for the cache item. * @param bool $modules_loaded * Whether all modules have already been loaded. */ - function __construct(CacheBackendInterface $cache, LockBackendInterface $lock, $tags = array(), $modules_loaded = FALSE) { + function __construct(CacheBackendInterface $cache, LockBackendInterface $lock, ActiveTheme $theme, $tags = array(), $modules_loaded = FALSE) { $this->cache = $cache; $this->lock = $lock; $this->tags = $tags; - $this->modules_loaded; + $this->theme = $theme; + $this->modulesLoaded = $modules_loaded; } /** @@ -79,7 +90,7 @@ */ protected function getPersistable() { if ($this->persistable === NULL) { - $this->persistable = $this->modules_loaded && \Drupal::hasRequest() && \Drupal::request()->isMethod('GET'); + $this->persistable = $this->modulesLoaded && \Drupal::hasRequest() && \Drupal::request()->isMethod('GET'); } return $this->persistable;