stop etemplate_widget_template::instance from returning a stdClass object for a not found template after content-expanding, leading to a fatal error in etemplate_widget line 338

This commit is contained in:
Ralf Becker 2015-03-17 14:07:20 +00:00
parent 2bd096f6e2
commit 387d5053dd

View File

@ -76,9 +76,9 @@ class etemplate_widget_template extends etemplate_widget
if (is_array(self::$request->content))
{
$expand_name = self::expand_name($name, '','','','',self::$cont);
if($expand_name && $expand_name != $name)
if ($expand_name && $expand_name != $name &&
($template = self::instance($expand_name, $template_set, $version, $load_via)))
{
$template = self::instance($expand_name, $template_set, $version, $load_via);
// Remember original, un-expanded name in case content changes while still cached
$template->original_name = $name;
return $template;