Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Tom Van Schoor / Tom Van Schoor (Tom VS)
Created: 10/25/2012
Components: Language, CF Component
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final / CF11 Update5,CF10 Update16
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Windows 7 64-bit
Vote Count: 2
Problem Description: When creating a component with accessors="true" and a property with a default value the variables struct does not contain the property in any method withing the component unless you set them explicitly in the init function.
Steps to Reproduce:
MyTest.cfc:
component accessors="true" {
property name="privateVarOne" default="privateVarOne default";
function init() {
return this;
}
public void function newMethod() {
var myVar = variables.privateVarOne;
writedump(var="success");
}
}
test.cfm:
<cfset test = new MyTest() />
<cfset test.newMethod() />
Actual Result:
Element PRIVATEVARONE is undefined in VARIABLES.
Expected Result:
success
Any Workarounds:
With a dump in-between it suddenly magically works:
<cfset test = new MyTest() />
<cfdump var="#test#" format="html">
<cfset test.newMethod() />
Explicit setting of variables.privateVarOne in the init function also works (without the dump)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3352745
External Customer Info:
External Company:
External Customer Name: Tom VS
External Customer Email:
External Test Config: My Hardware and Environment details:
Tested on several installations and pc. (all windows 7 64bit though)
Attachments:
Comments: