tracker issue : CF-3539842

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

Bug with dotted key names in structs

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 04/10/2013

Components: Language

Versions: 10.0

Failure Type: Data Loss

Found In Build/Fixed In Build: Final / 286508

Priority/Frequency: Critical / Some users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Problem Description:
Dotted key names have a bug. This was introduced in CF9 (the problem is not apparent in CF 8.0.1)

Thanks to Andrew Myers for bringing this to my attention. Details here: http://adamcameroncoldfusion.blogspot.co.uk/2013/04/plutarch-via-andrew-myers-teaches-me.html

Steps to Reproduce:
<p>It's okay to use a dot in a struct key, as long as that is the end of the line, eg.</p>

<cfset plutarch=StructNew()>
<cfset plutarch['lives.antony']="Antony's grandfather was the orator Antonius, who joined the party of Sulla...">
<cfset plutarch['lives.brutus']="Marcus Brutus was a descendant of that Junius Brutus whose bronze statue, with...">
<cfset plutarch['lives.caesar']="The wife of Caesar was Cornelia, the daughter of the Cinna...">
<cfset plutarch['lives.caesar.notes']=StructNew()>
<cfset plutarch['lives.caesar.notes'].one = "Many think that opening paragraphs of this Life, describing the birth and boyhood of Caesar, have been lost.">

<p>It seems all these keys work independently of each other - ie. a dot is a valid character in a struct key.  But what happens now if we assign something to 'lives'?</p>

<cfdump var="#plutarch#">

<cfset plutarch['lives'] = "A series of biographies of famous Greeks and Romans, arranged in pairs to illuminate their common moral virtues and vices...">

<cfdump var="#plutarch#">

<p>Still good....</p>
<p>Or is it?  What if what we want to assign is another struct?</p>

<cfset plutarch['lives'] = StructNew()>

<cfdump var="#plutarch#">

<p>Ooops!</p>

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

Watson Bug ID:	3539842

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Can you please explain how this is "high risk"? It's a bug in <cfdump>. Whatever the fix is, which is basically "make it work properly", how can it be high risk? Basically if you are paying attention to what the key names actually are in CFDUMP - which you must be if this is causing you problems - you're doing it wrong. Anyway, why's it "high risk"? -- Adam
Comment by External U.
15755 | October 08, 2013 03:46:58 AM GMT
On the surface it looked like a bug in the variable resolution. However, it is indeed a bug in cfdump. Re-opening it.
Comment by Rupesh K.
15756 | October 08, 2013 06:21:32 AM GMT
Thanks Rupesh. -- Adam
Comment by External U.
15757 | October 08, 2013 06:24:44 AM GMT