Skip to content

Commit

Permalink
Merge branch 'release/1.7.39.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 21, 2023
2 parents 8a7e387 + 88350d9 commit f086f84
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.7.39.3
## 02/21/2023

1. [](#bugfix)
* Fix for overzealous modular page template rendering fix in 1.7.39 causing Feed plugin to break [#3689](https://github.com/getgrav/grav/issues/3689)

# v1.7.39.2
## 02/20/2023

Expand Down
2 changes: 1 addition & 1 deletion system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.7.39.2');
define('GRAV_VERSION', '1.7.39.3');
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
define('GRAV_TESTING', false);

Expand Down
12 changes: 9 additions & 3 deletions system/src/Grav/Common/Twig/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,19 @@ public function prependPath($template_path, $namespace = '__main__')
/**
* Simple helper method to get the twig template if it has already been set, else return
* the one being passed in
* NOTE: Modular pages that are injected should not use this pre-set template as it's usually set at the page level
*
* @param string $template the template name
* @return string the template name
*/
public function template($template)
public function template(string $template): string
{
return $this->template ?? $template;
if (isset($this->template)) {
$template = $this->template;
unset($this->template);
}

return $template;
}

/**
Expand All @@ -513,7 +519,7 @@ public function getPageTwigTemplate($page, &$format = null)
$default = $page->isModule() ? 'modular/default' : 'default';
$extension = $format ?: $page->templateFormat();
$twig_extension = $extension ? '.'. $extension .TWIG_EXT : TEMPLATE_EXT;
$template_file = $template . $twig_extension;
$template_file = $this->template($template . $twig_extension);

// TODO: no longer needed in Twig 3.
/** @var ExistsLoaderInterface $loader */
Expand Down

0 comments on commit f086f84

Please sign in to comment.