From ea010f19f0194540aefc9b06a1e1e3fbbb2b2781 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 17 Feb 2023 16:00:46 -0700 Subject: [PATCH] Fix for bad rendering of modules --- CHANGELOG.md | 1 + system/src/Grav/Common/Twig/Twig.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 786867a9c..7b9a1aca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## mm/dd/2023 1. [](#bugfix) + * Fixed an issue with modular pages rendering thew wrong template when dynamically changing the page * Fixed an issue with `email` validation that was failing on UTF-8 characters. Following best practices and now only check for `@` and length. # v1.7.38 diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index 66a9d786c..1d2beb953 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -513,7 +513,7 @@ class Twig $default = $page->isModule() ? 'modular/default' : 'default'; $extension = $format ?: $page->templateFormat(); $twig_extension = $extension ? '.'. $extension .TWIG_EXT : TEMPLATE_EXT; - $template_file = $this->template($page->template() . $twig_extension); + $template_file = $template . $twig_extension; // TODO: no longer needed in Twig 3. /** @var ExistsLoaderInterface $loader */