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 @@ -38,6 +38,11 @@ protected $completeRegistry; /** + * Whether all modules have already been loaded. + */ + protected $modules_loaded; + + /** * Constructs a ThemeRegistry object. * * @param \Drupal\Core\Cache\CacheBackendInterface $cache @@ -53,6 +58,7 @@ $this->cache = $cache; $this->lock = $lock; $this->tags = $tags; + $this->modules_loaded; } /** @@ -73,7 +79,7 @@ */ protected function getPersistable() { if ($this->persistable === NULL) { - $this->persistable = $modules_loaded && \Drupal::hasRequest() && \Drupal::request()->isMethod('GET'); + $this->persistable = $this->modules_loaded && \Drupal::hasRequest() && \Drupal::request()->isMethod('GET'); } return $this->persistable;