diff --git a/change_log.txt b/change_log.txt index 94d612c1..90e5e38f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +24.11.2011 +- bugfix a subtemplate later used as main template did use old variable values + 21.11.2011 - bugfix cache file could include unneeded modifier plugins under certain condition diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 56b98fc7..ce753d18 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1191,6 +1191,8 @@ class Smarty extends Smarty_Internal_TemplateBase { $tpl = clone $this->template_objects[$_templateId]; $tpl->smarty = clone $tpl->smarty; $tpl->parent = $parent; + $tpl->tpl_vars = array(); + $tpl->config_vars = array(); } else { $tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id); } @@ -1198,6 +1200,9 @@ class Smarty extends Smarty_Internal_TemplateBase { if (isset($this->template_objects[$_templateId])) { // return cached template object $tpl = $this->template_objects[$_templateId]; + $tpl->parent = $parent; + $tpl->tpl_vars = array(); + $tpl->config_vars = array(); } else { $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id); }