ColdFusion problem or not?

I believe this actually is, but is there any reason why this doesn’t work

rc.user = ORMService.findWhere(entityName=‘user’, criteria = { username = event.getValue(‘username’,’’), password = arguments.event.getValue(‘password’,’’)});

Where this does

local.criteria = { username = event.getValue(‘username’,’’), password = arguments.event.getValue(‘password’,’’)};

rc.user = ORMService.findWhere(entityName=‘user’, criteria = local.criteria);

Regards,

Andrew Scott

http://www.andyscott.id.au/

I can’t think of any.

I believe this actually is, but is there any reason why this doesn’t work

rc.user = ORMService.findWhere(entityName=‘user’, criteria = { username = event.getValue(‘username’,’’), password = arguments.event.getValue(‘password’,’’)});

Where this does

local.criteria = { username = event.getValue(‘username’,’’), password = arguments.event.getValue(‘password’,’’)};

rc.user = ORMService.findWhere(entityName=‘user’, criteria = local.criteria);

Regards,

Andrew Scott

http://www.andyscott.id.au/

Define "doesn't work"...

(otherwise, there doesn't seem to be any reason for a difference
between the two forms)

Yeah sorry guys, the error is that the variable event doesn't exist.

Regards,
Andrew Scott
http://www.andyscott.id.au/

I noticed you have plain event.getValue() for username and
arguments.event.getValue() for password (not that that should make any
difference to the error but it did make me wonder about the context of
your code and what's really going on...).

Yeah because I copied and pasted the code, in between trying fully scoped
variables.

But It is a problem, and I don't know why this is the case.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Sean Corfield
Sent: Monday, 23 August 2010 11:22 AM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:5425] ColdFusion problem or not?

> Yeah sorry guys, the error is that the variable event doesn't exist.

I noticed you have plain event.getValue() for username and
arguments.event.getValue() for password (not that that should make any
difference to the error but it did make me wonder about the context of

your

I think it's a CF9 bug:

<cfscript>
function what( x ) {
writedump(x);
return 0;
}
function test( event ) {
rc.user = what(x = { username = arguments } );
}
test( variables );
</cfscript>

Fails with Variable ARGUMENTS is undefined on CF9, works on Railo.

Yeah I am going to agree with you, I think I have come across this before
when not using ColdBox.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Sean Corfield
Sent: Monday, 23 August 2010 1:20 PM
To: coldbox@googlegroups.com
Subject: Re: [coldbox:5427] ColdFusion problem or not?

I think it's a CF9 bug:

<cfscript>
function what( x ) {
writedump(x);
return 0;
}
function test( event ) {
rc.user = what(x = { username = arguments } ); } test( variables );

</cfscript>