diff -u b/core/lib/Drupal/Core/Template/TwigEnvironment.php b/core/lib/Drupal/Core/Template/TwigEnvironment.php --- b/core/lib/Drupal/Core/Template/TwigEnvironment.php +++ b/core/lib/Drupal/Core/Template/TwigEnvironment.php @@ -154,7 +154,7 @@ // If autoreload is on, check that the template has not been // modified since the last compilation. - if ($this->isAutoReload() && !$this->isFresh($cache_filename, $name)) { + if ($this->isAutoReload() && !$this->isFresh($cache_filename, $name, $inline)) { $this->updateCompiledTemplate($cache_filename, $name, $inline); } @@ -180,8 +180,8 @@ } } - return $this->getLoader()->isFresh($name, $time); - } + return $this->getLoader($inline)->isFresh($name, $time, $inline); + } /** * Gets the PHP code storage object to use for the compiled Twig files.