diff --git a/change_log.txt b/change_log.txt index 53031a1c..71211f2d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +10/09/2010 +- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results) + 08/09/2010 - allow multiple template inheritance branches starting in subtemplates diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 5d85108c..4e10a396 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -27,13 +27,15 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase { $this->optional_attributes = array('assign', 'nocache'); // check and get attributes $_attr = $this->_get_attributes($args); - $save = array($_attr, $compiler->parser->current_buffer, $this->compiler->nocache); + $save = array($_attr, $compiler->parser->current_buffer, $this->compiler->nocache, $this->compiler->smarty->merge_compiled_includes); $this->_open_tag('block', $save); if (isset($_attr['nocache'])) { if ($_attr['nocache'] == 'true') { $compiler->nocache = true; } - } + } + // must merge includes + $this->compiler->smarty->merge_compiled_includes = true; $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser); $compiler->has_code = false; @@ -103,7 +105,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase { $_output = $compiler->parser->current_buffer->to_smarty_php(); } $compiler->parser->current_buffer = $saved_data[1]; - $compiler->nocache = $saved_data[2]; + $compiler->nocache = $saved_data[2]; + $compiler->smarty->merge_compiled_includes = $saved_data[2]; // $_output content has already nocache code processed $compiler->suppressNocacheProcessing = true; return $_output; diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 7c6f4eb5..ad770181 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -105,7 +105,12 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { // load cache resource if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) { $this->cache_resource_object = $this->smarty->cache->loadResource(); - } + } + // copy block data of template inheritance + if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) { + $this->block_data = $this->parent->block_data; + } + } /**