diff --git a/change_log.txt b/change_log.txt index 800de6f2..f76ec278 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== + 08.03.2014 + - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177) + 17.02.2014 - bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343) diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index ba26ed0a..377288df 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -376,6 +376,13 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil // check and get attributes $_attr = $this->getAttributes($compiler, $args); + // update template with original template resource of {block} + $compiler->template->template_resource = realpath(trim($_attr['file'], "'")); + // source object + unset ($compiler->template->source); + $exists = $compiler->template->source->exists; + + // must merge includes if ($_attr['nocache'] == true) { $compiler->tag_nocache = true;