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: