Title:
Form Fields with the same name are converted to arrays when Fusebox 5.5 is used.
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/AsDesigned
Reporter/Name(from Bugbase): Dan Wilson / Dan Wilson (Dan Wilson)
Created: 05/20/2015
Components: Language, Framework Support
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / Most users will encounter
Locale/System: English / Win 2012 Server x64
Vote Count: 2
It appears the behavior of Form Fields with the same name has changed after I updated ColdFusion 11 to Update 5. The application had been working, but as of the update, we noticed form fields with the same name were coming through as Arrays. I added the this.sameformfieldsasarray = false in both the Application.cfc in the root of the project and also in the Application.cfc in the Fusebox framework, but I still get arrays when I access parameters in Fusebox.
Attached is a sample app, containing the Fusebox 5.5 files and a quick demonstration. After you run the code, you can open the Application.cfc in the Fusebox5 directory and verify the this.sameformfieldsasarray parameter is set. A few lines down, there is the following code:
<cfset structAppend(attributes,URL,true) />
<cfset structAppend(attributes,form,true) />
Dumping Form or URL in this Application.cfc results in Arrays for any formfields with the same name. If the form fields are text boxes, the array is sized for the number of elements, regardless of whether there is any text in the text box. Checkboxes are different and only populated checkboxes are added to the array.
Problem Description:
Form fields with the same name are combined into an array when using an Application.cfm file on Windows 2012 x64 install of ColdFusion 11 update 5.
The setting should be off by default.
Steps to Reproduce:
Unzip the attachment into your webroot.
Call it like this: http://localhost/testcase/index.cfm?fuseaction=util.formfields
Add values to the form text fields and also check some of the checkboxes.
Push the submit button. Both the form scope, and the specific values will be dumped to the screen. Note, the values coming through Fusebox will be arrays.
The string <cfset this.sameformfieldsasarray = "false" /> has been added to the Application.cfc in the root of the application, as well as the Application.cfc in the Fusebox framework.
Actual Result:
The form struct contains an array called formField
Expected Result:
The form struct should contain a list called formField
Any Workarounds:
Can loop through the form scope on every request and convert arrays to lists
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3991872
External Customer Info:
External Company:
External Customer Name: Dan
External Customer Email:
External Test Config: My Hardware and Environment details:
Server Product ColdFusion
Version 11,0,05,293506
Tomcat Version 7.0.54.0
Edition Enterprise
Operating System Windows Server 2012
OS Version 6.2
Update Level C:/ColdFusion11/cfusion/lib/updates/chf11000005.jar
Adobe Driver Version 5.1.3 (Build 000094)
JVM Details
Java Version 1.7.0_51
Java Vendor Oracle Corporation
Java Vendor URL http://java.oracle.com/
Java Home C:\ColdFusion11\jre
Java File Encoding Cp1252
Java Default Locale en_US
Attachments:
- May 21, 2015 00:00:00: 1_TestCase.zip
- September 02, 2015 00:00:00: 2_0-all_checkboxes.png
- September 02, 2015 00:00:00: 3_1-one_checkbox.png
- September 02, 2015 00:00:00: 4_2-no-checkbox.png
Comments: