diff --git a/change_log.txt b/change_log.txt index cf8094c9..7ce66e1e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== + 06.04.2014 + - bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187) + 05.04.2014 - bugfix default date format leads to extra spaces when displaying dates with single digit days (Issue 182) diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 377288df..02546c0b 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -84,7 +84,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase $this->template->block_data[$_name]['source'] = ''; // build {block} for child block self::$block_data[$_name]['source'] = - "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}'" . + "{$compiler->smarty->left_delimiter}private_child_block name={$_attr['name']} file='{$compiler->template->source->filepath}' type='{$compiler->template->source->type}' resource='{$compiler->template->template_resource}'" . " uid='{$compiler->template->source->uid}' line={$compiler->lex->line}"; if ($_attr['nocache']) { self::$block_data[$_name]['source'] .= ' nocache'; @@ -361,7 +361,7 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil * @var array * @see Smarty_Internal_CompileBase */ - public $required_attributes = array('name', 'file', 'uid', 'line'); + public $required_attributes = array('name', 'file', 'uid', 'line', 'type', 'resource'); /** @@ -377,7 +377,11 @@ class Smarty_Internal_Compile_Private_Child_Block extends Smarty_Internal_Compil $_attr = $this->getAttributes($compiler, $args); // update template with original template resource of {block} - $compiler->template->template_resource = realpath(trim($_attr['file'], "'")); + if (trim($_attr['type'], "'") == 'file') { + $compiler->template->template_resource = realpath(trim($_attr['file'], "'")); + } else { + $compiler->template->template_resource = trim($_attr['resource'], "'"); + } // source object unset ($compiler->template->source); $exists = $compiler->template->source->exists;