diff --git a/change_log.txt b/change_log.txt index 077fad49..d01dcbb8 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== SVN trunk ===== +27/07/2011 +- bugfix subtemplate could use wrong varibale scope when it was recalled from different templates + 26/07/2011 - bugfix experimental getTags() method did not work diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index d221ef0a..a85be6d5 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -143,7 +143,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { if ($_caching != 'null' && $_caching != Smarty::CACHING_OFF) { $_output .= "\$sha = sha1($include_file . $_cache_id . $_compile_id);\n"; $_output .= "if (isset(\$_smarty_tpl->smarty->template_objects[\$sha])) {\n"; - $_output .= "\$_template = \$_smarty_tpl->smarty->template_objects[\$sha]; \$_template->caching = $_caching; \$_template->cache_lifetime = $_cache_lifetime;\n"; + $_output .= "\$_template = \$_smarty_tpl->smarty->template_objects[\$sha]; \$_template->parent = \$_smarty_tpl; \$_template->caching = $_caching; \$_template->cache_lifetime = $_cache_lifetime;\n"; $_output .= "} else {\n"; } $_output .= "\$_template = new {$compiler->smarty->template_class}($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, $_cache_id, $_compile_id, $_caching, $_cache_lifetime);\n";