From af13907219106fcef2b4cb78ae5943756c3c8ff9 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews@googlemail.com" Date: Sat, 8 Mar 2014 23:03:08 +0000 Subject: [PATCH] 08.03.2014 - bugfix relative file path {include} within {block} of child templates did throw exception on first call (Issue 177) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_compile_block.php | 7 +++++++ 2 files changed, 10 insertions(+) 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;