- bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-10-01 21:03:40 +00:00
parent 7add711ea0
commit 2a311c5473
2 changed files with 7 additions and 0 deletions

View File

@@ -78,6 +78,12 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase
$_attr = $this->getAttributes($compiler, $args);
$_name = trim($_attr['name'], "\"'");
// existing child must override parent settings
if (isset($compiler->template->block_data[$_name]) && $compiler->template->block_data[$_name]['mode'] == 'replace') {
$_attr['append'] = false;
$_attr['prepend'] = false;
}
// check if we process an inheritance child template
if ($compiler->inheritance_child) {
array_unshift(self::$nested_block_names, $_name);