tracker issue : CF-3630936

select a category, or use search below
(searches all categories and all time range)
Title:

Query cfdump fields not aligned with data V2

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Nando Breiter / Nando Breiter (Nando Breiter)

Created: 09/12/2013

Components: Debugging, CFDump

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Mac All

Vote Count: 0

Problem Description:

cfdump display is broken under certain conditions. 

Steps to Reproduce: Unzip the attached simple templates and alter the query in test.cfm to work in your environment. Browse to test.cfm and cfdump works as expected. Browse to testDump.cfm and cfdump's display is broken. The reason seems to be that whitespace is being stripped from the output using the regex REReplace(renderedContent, "[[:space:]]{2,}","","ALL"). Because there are errant consecutive spaces in the the dump.cfm template, optimally stripping whitespace from ColdFusion's output breaks the display. See below for an example copied from view source in the browser:

<tdstyle="cursor:pointer;" title="click to collapse" onClick="cfdump_toggleRow_qry(this);" class="query">

It could be argued that the developers need to be careful when stripping whitespace, in other words they should make their regex's less than optimal to make sure code is never collapsed. But it could also be argued that this would be a very simple fix and cfdump shouldn't be so fragile. 

To fix this, I believe someone just needs to open the source template of dump.cfm and repetitively search and replace all instances of 2 consecutive spaces with one space until no space-space instances are found. That should prevent any regex that strips whitespace from collapsing code together and thereby breaking functionality. Missing semicolons in the CSS or Javascript sections might also create problems here.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3630936

External Customer Info:
External Company:  
External Customer Name: Nando Breiter
External Customer Email:  
External Test Config: My Hardware and Environment details: I have CF 10 installed on a Mac OSX 10.7.5 as my dev machine, and it is patched to Update 11. I have not tested this on other versions of CF.

Attachments:

  1. September 12, 2013 00:00:00: 1_testDump.zip

Comments:

After digging deeper into why this was occurring for me, this is a clarification of CF-3629697 that I submitted about a day ago with a reproducible test case added.
Comment by External U.
14524 | September 12, 2013 08:31:12 AM GMT
Update "testDump.cfm" with this: <!--- replace 2 spaces with 1 ---> <CFSET renderedContent = reReplace(renderedContent, "[[:space:]]{2,}", " ", "all")> <CFSET renderedContent = replace(renderedContent, "> <", "><", "all")> <CFSET renderedContent = reReplace(renderedContent, "<!--[^>]+>", "", "all")>
Comment by External U.
14525 | September 12, 2013 10:57:14 AM GMT