Question

How can you disable the sameformfieldsasarray when you have an Application.cfm file?

I'm porting a legacy application from ColdFusion 9 to ColdFusion 10. The site uses an old school Application.cfm file.

I see that 10 added a new setting (this.sameformfieldsasarray) that you can enable that will combine form variables into an array when there is more than one of them. This is supposed to be off by default, but unfortunately it's "on" for the fresh installation I just set up.

I can't set this.sameformfieldsasarray false because we've got Application.cfm instead of Application.cfc, and I can't find anything in the admin or documentation.

The code is run from a fresh install of CF10 on Ubuntu 12.04 x64. @Adam verified that the sample code worked on Windows Server 2003 x64.


Code: https://gist.github.com/2931343

Screenshot of sample submit: http://imgur.com/Q9DAi

Screenshot of server scope: http://imgur.com/9iwWL

Bug report submitted: https://bugbase.adobe.com/index.cfm?event=bug&id=3214734

Was it helpful?

Solution

This issue is now resolved in ColdFusion 10 Update 1 which was released on 31st August 2012.

Applying the update should resolve the issue and allow workarounds such as the one suggested by Mark A Kruger to be removed.

OTHER TIPS

I'm not sure about this one. CF 10 is so new that you are probably the first person to ask this question in public (ha). But perhaps you could do the following in your application.cfm.

<cfloop collection="#form#" item="fitem">
    <cfif isArray(form[fitem])>
        <cfset form[fitem] = arraytolist(form[fitem])/>
    </cfif>
</cfloop>

That would set things right I suspect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top