- bugfix for change of 08/09/2010 (final {block} tags in subtemplates did not produce correct results)

This commit is contained in:
uwe.tews@googlemail.com
2010-09-10 11:15:15 +00:00
parent 550a416209
commit 255c271246
3 changed files with 15 additions and 4 deletions

View File

@@ -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 08/09/2010
- allow multiple template inheritance branches starting in subtemplates - allow multiple template inheritance branches starting in subtemplates

View File

@@ -27,13 +27,15 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$this->optional_attributes = array('assign', 'nocache'); $this->optional_attributes = array('assign', 'nocache');
// check and get attributes // check and get attributes
$_attr = $this->_get_attributes($args); $_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); $this->_open_tag('block', $save);
if (isset($_attr['nocache'])) { if (isset($_attr['nocache'])) {
if ($_attr['nocache'] == 'true') { if ($_attr['nocache'] == 'true') {
$compiler->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->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
$compiler->has_code = false; $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(); $_output = $compiler->parser->current_buffer->to_smarty_php();
} }
$compiler->parser->current_buffer = $saved_data[1]; $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 // $_output content has already nocache code processed
$compiler->suppressNocacheProcessing = true; $compiler->suppressNocacheProcessing = true;
return $_output; return $_output;

View File

@@ -105,7 +105,12 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
// load cache resource // load cache resource
if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) { 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(); $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;
}
} }
/** /**