From 5b6050bf5466793a2e8e3105ea8febc83d28abd0 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Sat, 14 Nov 2009 16:20:18 +0000 Subject: [PATCH] - fix on merging compiled templates with nocache sections in nocache includes --- change_log.txt | 1 + libs/sysplugins/smarty_internal_compile_include.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index ede46283..773ea176 100644 --- a/change_log.txt +++ b/change_log.txt @@ -3,6 +3,7 @@ - bugfix modifiers on registered object tags - fixed locaion where outputfilters are running - fixed config file definitions at EOF +- fix on merging compiled templates with nocache sections in nocache includes 11/12/2009 - fixed variable filenames in {include_php} and {insert} diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index cc8ebb0a..07b1e6c4 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -100,7 +100,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { } } // default for included templates - if ($compiler->template->caching) { + if ($this->compiler->template->caching && !$this->compiler->nocache) { $_caching = SMARTY_CACHING_LIFETIME_CURRENT; } else { $_caching = SMARTY_CACHING_OFF; @@ -117,6 +117,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { if (isset($_attr['nocache'])) { if ($_attr['nocache'] == 'true') { $this->compiler->tag_nocache = true; + $_caching = SMARTY_CACHING_OFF; } } if (isset($_attr['caching'])) { @@ -151,7 +152,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { if (isset($_assign)) { $_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate()); ?>"; } else { - if ($has_compiled_template) { + if ($has_compiled_template && !($compiler->template->caching && ($this->compiler->tag_nocache || $this->compiler->nocache))) { $_output .= " \$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n"; $_output .= $compiled_tpl . "getTemplateFilepath() . "\" */ ?>"; $_output .= "";