coldbox 3.5
MailSettingsBean.cfc
LINE 83: (Error DEFAULT DOES NOT EXIST IN INSTANCE
if( structKeyExists(arguments,"default") ){ return instance.default; }
CHANGE IT TO: (works fine)
if( structKeyExists(arguments,"default") ){ return
arguments.default; }
do you concur?
This is a ColdFusion bug and I have reported this to Adobe, as it works in Railo.
Hi there Scott,
Actually I forgot to mention that, 'Im runing Railo 3.3.2.005 Final
Regards,
Felipe Serrano
Maybe Railo fixed that then, I know in Builder if you do something like this
instance.default = {};
Will work in ColdFusion, but this will not
instance = {
default = “test”
}
When I tried the latter in Railo it works even though CF Builder complains about it.
And how the hell do people get me name wrong? Do people no longer get taught that if there is no comma between the names that it is always first name then last name?
Take a look into this function (original):
<cffunction name="getValue" output="false" access="public"
returntype="any" hint="Get a value of a setting">
<cfargument name="setting" type="any" required="true" hint="The
name of the setting to retrieve"/>
<cfargument name="default" type="any" required="false" hint="The
default value to return">
<cfscript>
if( structKeyExists(instance, arguments.setting) ){ return
instance[arguments.setting];}
if( structKeyExists(arguments,"default") ){ return
instance.default; } //THIS LINE GIVES THE ERROR
</cfscript>
<cfthrow type="MailSettingsBean.InvalidValue"
message="The setting you requested #arguments.setting# does not
exist"
detail="Valid settings are #structKeyList(instance)#">
</cffunction>
WHEN CHANGE IT TO:
if( structKeyExists(arguments,"default") ){ return
arguments.default; } //THIS LINE WORKS
That is what I got
Thanks
Felipe Serrano
Either way this is not a ColdBox problem, you may need to ask this question over on the Railo list.
I might be missing something here, but this looks like a coldbox bug to me. getValue() should return arguments.default, not instance.default, which is what the OP is saying works.