diff --git a/change_log.txt b/change_log.txt index b95c68b7..3b704f52 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,8 @@ +13/11/2010 +- bugfix on {debug} + +===== Smarty 3.0.2 ===== + 12/11/2010 - reactivated $error_reporting property handling - fixed typo in compile_continue diff --git a/libs/sysplugins/smarty_internal_compile_debug.php b/libs/sysplugins/smarty_internal_compile_debug.php index 69867fcd..55b8a957 100644 --- a/libs/sysplugins/smarty_internal_compile_debug.php +++ b/libs/sysplugins/smarty_internal_compile_debug.php @@ -30,7 +30,7 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase { $this->compiler->tag_nocache = true; // display debug template - $_output = "smarty->plugins_dir); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty); ?>"; + $_output = "smarty->plugins_dir); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>"; return $_output; } } diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index 00e6a69c..e9cf821c 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -73,12 +73,21 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { /** * Opens a window for the Smarty Debugging Consol and display the data */ - public static function display_debug($smarty) + public static function display_debug($obj) { // prepare information of assigned variables - $_assigned_vars = $smarty->tpl_vars; + $ptr = $obj; + while (isset($ptr->parent)) { + $ptr = $ptr->parent; + } + if ($obj instanceof Smarty) { + $smarty = $obj; + } else { + $smarty = $obj->smarty; + } + $_assigned_vars = $ptr->tpl_vars; ksort($_assigned_vars); - $_config_vars = $smarty->config_vars; + $_config_vars = $ptr->config_vars; ksort($_config_vars); $ldelim = $smarty->left_delimiter; $rdelim = $smarty->right_delimiter;