From 27be6508bdecb10ca3fbc27287d7b3c994c16a7a Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Tue, 20 Nov 2012 02:06:20 +0000 Subject: [PATCH] - bugfix assignGlobal() called from plugins did not work (Forum Topic 23771) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_data.php | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/change_log.txt b/change_log.txt index 114a0476..cf4e5d65 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +20.11.2012 +- bugfix assignGlobal() called from plugins did not work (Forum Topic 23771) + 13.11.2012 - adding attribute "strict" to html_options, html_checkboxes, html_radios to only print disabled/readonly attributes if their values are true or "disabled"/"readonly" (Issue #120) diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php index 5baf3b76..1d7b1d33 100644 --- a/libs/sysplugins/smarty_internal_data.php +++ b/libs/sysplugins/smarty_internal_data.php @@ -80,6 +80,11 @@ class Smarty_Internal_Data { { if ($varname != '') { Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache); + $ptr = $this; + while ($ptr instanceof Smarty_Internal_Template) { + $ptr->tpl_vars[$varname] = clone Smarty::$global_tpl_vars[$varname]; + $ptr = $ptr->parent; + } } return $this;