- bugfix parent pointer was not set when fetch() for other template was called on template object

This commit is contained in:
uwe.tews@googlemail.com
2011-10-07 15:30:04 +00:00
parent b7ef6f0597
commit 4c070d0bda
2 changed files with 3 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
- bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049) - bugfix html_options plugin did not handle object values properly (Issue #49, Forum Topic 20049)
- improvement html_checkboxes and html_radios to accept null- and object values, and label_ids attribute - improvement html_checkboxes and html_radios to accept null- and object values, and label_ids attribute
- improvement removed some unnecessary count()s - improvement removed some unnecessary count()s
- bugfix parent pointer was not set when fetch() for other template was called on template object
06.10.2011 06.10.2011
- bugfix switch lexer internals depending on mbstring.func_overload - bugfix switch lexer internals depending on mbstring.func_overload

View File

@@ -38,14 +38,13 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
$parent = $cache_id; $parent = $cache_id;
$cache_id = null; $cache_id = null;
} }
if ($parent === null && $this instanceof Smarty) { if ($parent === null && ($this instanceof Smarty || is_string($template))) {
// get default Smarty data object
$parent = $this; $parent = $this;
} }
// create template object if necessary // create template object if necessary
$_template = ($template instanceof $this->template_class) $_template = ($template instanceof $this->template_class)
? $template ? $template
: $this->createTemplate($template, $cache_id, $compile_id, $parent, false); : $this->smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
// merge all variable scopes into template // merge all variable scopes into template
if ($merge_tpl_vars) { if ($merge_tpl_vars) {
// save local variables // save local variables