Skip to content

Commit

Permalink
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (for…
Browse files Browse the repository at this point in the history
…um topic 25508) 2nd fix
  • Loading branch information
uwetews committed Apr 28, 2015
1 parent e312dd9 commit ea17aad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
 ===== 3.1.22-dev ===== (xx.xx.2015)
28.04.2015
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508) 2nd fix

28.04.2015
- bugfix plugins of merged subtemplates not loaded in 3.1.22-dev (forum topic 25508)

Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.22-dev/20';
const SMARTY_VERSION = '3.1.22-dev/21';

/**
* define variable scopes
Expand Down
15 changes: 14 additions & 1 deletion libs/sysplugins/smarty_internal_compile_include.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,20 @@ public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler,
}
$compiler->parent_compiler->mergedSubTemplatesCode[$tpl->properties['unifunc']] = $compiled_code;
$has_compiled_template = true;
$compiler->template->required_plugins = array_merge_recursive($compiler->template->required_plugins, $tpl->required_plugins);
if (!empty($tpl->required_plugins['compiled'])) {
foreach ($tpl->required_plugins['compiled'] as $name => $callBack) {
if (!isset($compiler->template->required_plugins['compiled'][$name])) {
$compiler->template->required_plugins['compiled'][$name] = $callBack;
}
}
}
if (!empty($tpl->required_plugins['nocache'])) {
foreach ($tpl->required_plugins['nocache'] as $name => $callBack) {
if (!isset($compiler->template->required_plugins['nocache'][$name])) {
$compiler->template->required_plugins['nocache'][$name] = $callBack;
}
}
}
unset ($tpl);
}
} else {
Expand Down

0 comments on commit ea17aad

Please sign in to comment.