tracker issue : CF-3298179

select a category, or use search below
(searches all categories and all time range)
Title:

ColdFusion 10 form variable functionality change relating to case of variables

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Tom Lofts / Tom Lofts (loftx)

Created: 07/28/2012

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 283412

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Win 2003 Server

Vote Count: 4

Problem Description:

I have come across a bug/change in functionality relating to the use of multiple form fields using the same name. In ColdFusion 9 these would have been appended to the relevant variable with commas, but in ColdFusion 10, if the case of the variables is different one field will overwrite the other.

Steps to Reproduce:

Create the following index.cfm (attached to report) file and submit the form

<form action="index.cfm" method="post">
    <input type="hidden" name="test" value="1" />
    <input type="hidden" name="TEST" value="0" />
    <input type="submit" />
</form>

<cfdump var="#form#">

Actual Result:

The CFDUMP shows

TEST = 0

Expected Result:

The CFDUMP should show

TEST = 1,0

Any Workarounds:

I believe it is possible to repopulate the form variable using the POST data from GetHttpRequestData() but I have not tested this behaviour.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3298179

Keywords:
FixTested


External Customer Info:
External Company:  
External Customer Name: loftx
External Customer Email:  
External Test Config: My Hardware and Environment details:



Tested on Windows 2003 running in VMWARE using ColdFusion 10.0 32bit Standard edition.

Attachments:

  1. July 28, 2012 00:00:00: 1_index.cfm

Comments:

It is worth noting this behavior differs depending on which enctype is used. With "multipart/form-data" the values are *not* overwritten, but FORM.FieldNames lists the field name twice: <cfdump var="#FORM#"> <form action="test.cfm" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="multipart/form-data"> <input type="hidden" name="test" value="1" /> <input type="hidden" name="TEST" value="0" /> <input type="submit" value="Using: enctype=multipart/form-data"/> </form> <form action="test.cfm" method="post" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="type" value="application/x-www-form-urlencoded"> <input type="hidden" name="test" value="1" /> <input type="hidden" name="TEST" value="0" /> <input type="submit" value="Using enctype=application/x-www-form-urlencoded"/> </form>
Comment by External U.
18654 | July 28, 2012 11:29:29 AM GMT
This change in behavior may break some applications and should definitely be fixed.
Vote by External U.
18656 | July 28, 2012 11:32:44 AM GMT
I can also confirm this bug with checkboxes. We had one checkbox on a form with the name="" attribute being a different case. That one field overwrote all the other checkboxes on submit, and the form scope in CF was incorrect.
Comment by External U.
18655 | August 22, 2012 09:22:10 AM GMT
Can cause major logic flaws in applications, particularly applications written for previous versions of ColdFusion where the case of the form variable didn't matter.
Vote by External U.
18657 | August 22, 2012 09:23:51 AM GMT
Quietly failing on legacy apps in very unfortunate ways. User accounts saved on new CF10 box lose all permissions. I know how to fix, but this is problematic.
Vote by External U.
18658 | October 29, 2012 02:53:19 PM GMT
We are having this issue as well. Many of our forms (and consequently our field names) are dynamically generated from mixed sources and it's not always easy to ensure one case or the other for our fields. We have encountered a few scenarios where we have mixed case among the same group of similarly named fields. Some of the user's selections are lost in this case.
Vote by External U.
18659 | January 10, 2013 02:31:16 PM GMT