- bugfix template inheritance fail when using custom resource after patch of 8.3.2014 (Issue 187)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-04-06 18:50:39 +00:00
parent 79d67afb0f
commit 668bc16717
2 changed files with 10 additions and 3 deletions

View File

@@ -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)

View File

@@ -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;