fixes #2481 - twig3 breaking editor preview

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-12-03 14:08:14 -07:00
parent e3886e5b4c
commit bc9158ebcf

View File

@@ -2369,7 +2369,10 @@ class AdminController extends AdminBaseController
// Add theme template paths to Twig loader
$template_paths = $this->grav['locator']->findResources('theme://templates');
$this->grav['twig']->twig->getLoader()->addLoader(new FilesystemLoader($template_paths));
$loader = $this->grav['twig']->loader();
foreach ($template_paths as $path) {
$loader->addPath($path);
}
$html = $page->content();