Skip to content

Commit

Permalink
- bugfix if fetch('foo.tpl') is called on a template object the $pare…
Browse files Browse the repository at this point in the history
…nt parameter should default to the calling template object #152
  • Loading branch information
uwetews committed Jan 28, 2016
1 parent 193163b commit a687a12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
 ===== 3.1.30-dev ===== (xx.xx.xx)
28.01.2016
- bugfix allow windows network filepath or wrapper (forum topic 25876) https://github.com/smarty-php/smarty/issues/170
- bugfix if fetch('foo.tpl') is called on a template object the $parent parameter should default to the calling template object https://github.com/smarty-php/smarty/issues/152

27.01.2016
- revert bugfix compiling {section} did create warning
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_internal_templatebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private function _execute($template, $cache_id, $compile_id, $parent, $function)
} else {
// get template object
/* @var Smarty_Internal_Template $template */
$template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent, false);
$template = $smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);
if ($this->_objType == 1) {
// set caching in template object
$template->caching = $this->caching;
Expand Down

2 comments on commit a687a12

@ophian
Copy link

@ophian ophian commented on a687a12 Jan 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really work for the ternary? Shouldn't this line
$smarty->createTemplate($template, $cache_id, $compile_id, $parent ? $parent : $this, false);
better be
$smarty->createTemplate($template, $cache_id, $compile_id, ($parent ? $parent : $this), false);?

@uwetews
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's valid code for the ternary.

Please sign in to comment.