Copy link to clipboard
Copied
I found what I would think is a somewhat big incompatibility between CF11 and all prior CF version: multiple checkbox and select values. If you have multiple checkboxes "checked" that refer to the same variable name, prior to CF11 these came in as a list; in CF11 they come in as an array causing "Complex object types cannot be converted to simple values." My question to Adobe, was this intentional or a bug?
Do you have a line like line three below at the top of your Application.cfc?
component {
this.name = "myApp";
this.sameformfieldsasarray=true;
}
This was a new feature introduced in CF10. If you want to force the old behavior, change the value to false (or remove it entirely, as the default is false).
Copy link to clipboard
Copied
Complex object? That doesn't sound like something caused by form field values.
Could you show your code? Then we could throw more eyes at it.
This works for me:
<cfdump var="#form#" >
<cfoutput><form action="#CGI.script_name#" method="post"></cfoutput>
<input name="chkbx" type="checkbox">
<input name="chkbx" type="checkbox">
<input name="chkbx" type="checkbox">
<input name="sbmt" type="submit" value="Post">
</form>
Copy link to clipboard
Copied
I'm using fusebox v5.5.1. Line 8 below is the code that was throwing the exception in CF11, not in CF9 that we upgraded from:
Here is the form:
<cfloop query="qUserContact">
<input type="checkbox" name="UserID" value="#UserID#" /> #UserName#<br/>
</cfloop>
Which translates into one or more input checkboxes:
<input type="checkbox" name="UserID" value="1" /> Name1<br/>
<input type="checkbox" name="UserID" value="2" /> Name2<br/>
<input type="checkbox" name="UserID" value="3" /> Name3<br/>
All the source code and fusebox version level was untouched in the migration. I guess it might not be the direct use of the FORM scope but how fusebox copies from the URL and FORM scope into the attributes scope (structure). In looking at the fusebox code it is doing a simple structappend:
<cfparam name="variables.attributes" default="#structNew()#" />
<cfif isDefined("url")>
<cfset structAppend(variables.attributes,url,true) />
</cfif>
<cfif isDefined("form")>
<cfset structAppend(variables.attributes,form,true) />
</cfif>
Copy link to clipboard
Copied
Do you have a line like line three below at the top of your Application.cfc?
component {
this.name = "myApp";
this.sameformfieldsasarray=true;
}
This was a new feature introduced in CF10. If you want to force the old behavior, change the value to false (or remove it entirely, as the default is false).
Copy link to clipboard
Copied
Thanks. I did not know about this change or app setting. Learned something new.