ranlt / smarty-php

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

If debugging = true, in some cases the html is rendered twice; once before the debug console, and once after #212

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
The only reproducible test case I have is on production code of sufficient 
complexity.
I am using Smarty 3's template inheritance with a base template which defines 
many named blocks.
I build up a list of templates to include and then use the 
display('extends:base.tpl|header.tpl|content.tpl|footer.tpl'); syntax to render.
When debugging = false, everything works fine. When I set debugging = true, I 
see the html output, then the javascript for the smarty debug console, then the 
html output again.

What is the expected output? What do you see instead?
I expect to see the html output once, regardless of wether or not debugging = 
true.

What version of the product are you using? On what operating system?
Smarty 3.1.21 on FreeBSD 7 & 10 with PHP 5.4.12

Please provide any additional information below.
This bug appeared in version 3.1.13.

I have been able to correct the issue I am seeing by modifying the 
display_debug() method in Smarty/libs/sysplugins/smarty_internal_debug.php to 
just use = instead of clone. Why are you using clone there anyway?

I've attached a patch. Unfortunately, I'm not sure how to reproduce this 
outside of my specific implementation, which I can't share due to legal reasons.
The change I made seems to still work in the simple case, as well as, my broken 
case.

Original issue reported on code.google.com by jeffreyd...@gmail.com on 11 Nov 2014 at 8:50

Attachments:

GoogleCodeExporter commented 9 years ago
Updated patch. Forgot to account for the change of object properties.

Original comment by jeffreyd...@gmail.com on 11 Nov 2014 at 9:32

Attachments:

GoogleCodeExporter commented 9 years ago
Minor tweak to patch. This should be the final proposed version.

Original comment by jeffreyd...@gmail.com on 11 Nov 2014 at 9:52

Attachments: