Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Sami Hoda / Sami Hoda (samihoda2)
Created: 11/02/2009
Components: Language, CF Component
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 258574
Priority/Frequency: Normal / Most users will encounter
Locale/System: English / Platforms All
Vote Count: 6
Problem:
Use of "LOCAL" inside a cffunction is broken. Certain use cases, such as pulling values from other functions and setting that to local, as many frameworks do, is broken. See: http://www.bytestopshere.com/post.cfm/major-flaw-in-cf9-may-break-codeTHIS IS A SEVERE ISSUE. WILL DELAY UPGRADES, AND BREAK NUMEROUS PROJECTS. SEE COMMENTS AS WELL IN BLOG ENTRY.
Method:
Use of "LOCAL" inside a cffunction is broken. Certain use cases, such as pulling values from other functions and setting that to local, as many frameworks do, is broken. See: http://www.bytestopshere.com/post.cfm/major-flaw-in-cf9-may-break-codeTHIS IS A SEVERE ISSUE. WILL DELAY UPGRADES, AND BREAK NUMEROUS PROJECTS. SEE COMMENTS AS WELL IN BLOG ENTRY.
<!--- local.cfc --->
<cfcomponent>
<cffunction name="doSomething" returntype="any" access="public" output="false" >
<cfset var local = getProperties() >
<cfset local.strVersion = SERVER.ColdFusion.ProductVersion >
<cfset local.strLevel = SERVER.ColdFusion.ProductLevel >
<cfreturn local >
</cffunction>
<cffunction name="getProperties" returntype="struct" access="private" output="false">
<cflog text="in getProperties()">
<cfset var local = structNew() >
<cfset local.firstName = "John" >
<cfset local.lastName = "Doe" >
<cfreturn local >
</cffunction>
</cfcomponent>
<!--- local.cfm --->
<cfset test = createObject("component","local")>
<cfset result = test.doSomething()>
<cfdump var = "#result#">
Result:
No error message!
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040372
External Customer Info:
External Company:
External Customer Name: Sami Hoda
External Customer Email: 46E545A3445FFD1F992015D5
External Test Config: 11/02/2009
Attachments:
Comments: