- 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

View File

@@ -1,6 +1,10 @@
 ===== 3.1.22-dev ===== (xx.xx.2015)
14.03.2015
- 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}
10.03.2015
- bugfix {include ... nocache} with variable file or compile_id attribute was not executed in nocache mode.
- bugfix {include ... nocache} whith variable file or compile_id attribute was not executed in nocache mode.
12.02.2015
- bugfix multiple Smarty::fetch() of same template when $smarty->merge_compiled_includes = true; could cause function already defined error

View File

@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.22-dev/9';
const SMARTY_VERSION = '3.1.22-dev/10';
/**
* define variable scopes

View File

@@ -246,13 +246,6 @@ 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;
}
}