Revision: 4877
Author:
Uwe....@googlemail.com
Date: Wed Oct 1 21:03:40 2014 UTC
Log: - bugfix existing child {block} tag must override parent {block}
tag append / prepend setting (topic 25259)
https://code.google.com/p/smarty-php/source/detail?r=4877
Modified:
/trunk/distribution/change_log.txt
/trunk/distribution/libs/sysplugins/smarty_internal_compile_block.php
=======================================
--- /trunk/distribution/change_log.txt Tue Sep 30 23:20:56 2014 UTC
+++ /trunk/distribution/change_log.txt Wed Oct 1 21:03:40 2014 UTC
@@ -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)
=======================================
--- /trunk/distribution/libs/sysplugins/smarty_internal_compile_block.php
Tue Sep 30 23:20:56 2014 UTC
+++ /trunk/distribution/libs/sysplugins/smarty_internal_compile_block.php
Wed Oct 1 21:03:40 2014 UTC
@@ -77,6 +77,12 @@
// check and get attributes
$_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) {