From 2a311c54736eafd7d27d3440e07c9f3b51d3ed69 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Wed, 1 Oct 2014 21:03:40 +0000 Subject: [PATCH] - bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259) --- change_log.txt | 1 + libs/sysplugins/smarty_internal_compile_block.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/change_log.txt b/change_log.txt index ef0c3347..d311f55c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ ===== 3.1.20-dev ===== (xx.xx.2014) 01.10.2014 - bugfix template resource of inheritance blocks could get invalid if the default resource type is not 'file'(Issue 202) + - bugfix existing child {block} tag must override parent {block} tag append / prepend setting (topic 25259) 02.08.2014 - bugfix modifier wordwrap did output break string wrong if first word was exceeding length with cut = true (topic 25193) diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 52062090..8c2fb975 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -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);