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 */