mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-28 02:41:37 +01:00
- bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user