- bugfix template functions defined with {function} in an included subtemplate could not be called in nocache

mode with {call... nocache} if the subtemplate had it's own cache file {forum 25452}
This commit is contained in:
Uwe Tews
2015-03-14 12:02:57 +01:00
parent e9b1f296cb
commit 8020144d46
3 changed files with 17 additions and 10 deletions
+11 -8
View File
@@ -246,14 +246,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
if ($this->parent instanceof Smarty_Internal_Template) {
$this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
$this->parent->properties['tpl_function'] = array_merge($this->parent->properties['tpl_function'], $this->properties['tpl_function']);
foreach ($this->required_plugins as $code => $tmp1) {
foreach ($tmp1 as $name => $tmp) {
foreach ($tmp as $type => $data) {
$this->parent->required_plugins[$code][$name][$type] = $data;
}
}
}
}
}
if ($this->smarty->debugging) {
Smarty_Internal_Debug::end_render($this);
}
@@ -323,6 +316,16 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
Smarty_Internal_Debug::end_template($this);
}
// return fetched content
if ($this->parent instanceof Smarty_Internal_Template) {
$this->parent->properties['tpl_function'] = array_merge($this->parent->properties['tpl_function'], $this->properties['tpl_function']);
foreach ($this->required_plugins as $code => $tmp1) {
foreach ($tmp1 as $name => $tmp) {
foreach ($tmp as $type => $data) {
$this->parent->required_plugins[$code][$name][$type] = $data;
}
}
}
}
return $content;
}
}