ranlt / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

section "included templates & config files" is not displayed in the smarty debug console #222

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Smarty-3.1.21/demo/index.php in a browser

What is the expected output?
The "included templates & config files (load time in seconds)" section is 
displayed in the smarty debug console.

Please provide any additional information below.

The patch is 

diff -ru /home/aim/tmp/Smarty-3.1.21/libs/sysplugins/smarty_internal_debug.php 
/home/aim/www/Smarty-3.1.21/libs/sysplugins/smarty_internal_debug.php
--- 
/home/aim/tmp/Smarty-3.1.21/libs/sysplugins/smarty_internal_debug.php   2014-10-19
 07:21:16.000000000 +0400
+++ 
/home/aim/www/Smarty-3.1.21/libs/sysplugins/smarty_internal_debug.php   2015-01-21
 11:23:42.201521677 +0300
@@ -171,7 +171,7 @@
         if ($obj instanceof Smarty_Internal_Template) {
             $_template->assign('template_name', $obj->source->type . ':' . $obj->source->name);
         }
-        if ($obj instanceof Smarty) {
+        if ($obj instanceof Smarty_Internal_Template) {
             $_template->assign('template_data', self::$template_data);
         } else {
             $_template->assign('template_data', null);

Original issue reported on code.google.com by a...@x-cart.com on 21 Jan 2015 at 8:27

GoogleCodeExporter commented 9 years ago
May be the code above should be adjusted as well

        if ($obj instanceof Smarty) {
            $smarty = clone $obj;
        } else {
            $smarty = clone $obj->smarty;
        }

Original comment by a...@x-cart.com on 21 Jan 2015 at 8:33