tracker issue : CF-4197259

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

[ANeff] Bug for: THIS.sameFormFieldsAsArray=true ignored when enctype="multipart/form-data"

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 11/03/2016

Components: General Server

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update3 / 303894

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

THIS.sameFormFieldsAsArray=true ignored when enctype="multipart/form-data"

Repro:

Application.cfc
----------------------
component {THIS.name = "SameFormFieldsAsArrayIgnoredWhenEnctypeIsMultipart"; THIS.sameFormFieldsAsArray = true;}

index.cfm
----------------------
<cfdump var="#FORM#">
<form method="post" enctype="multipart/form-data">
  <input type="text" name="foo" value="one">
  <input type="text" name="foo" value="">
  <input type="text" name="foo" value="three">
  <input type="submit" name="submit">
</form>

Run the above, and submit the form.

Actual result: FORM.foo is list "one,three"

Expected result: FORM.foo is array ["one","","three"]

Verified in CF2016 Update 3 (build 2016.0.03.300466)

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

Watson Bug ID:	4197259

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:

Attachments:

Comments:

UPDATE: It -partially- works. It works for file inputs but not other inputs. Please change index.cfm to this: <cfdump var="#FORM#"> <form method="post" enctype="multipart/form-data"> <input type="text" name="foo" value="one"> <input type="text" name="foo" value=""> <input type="text" name="foo" value="three"> <input type="file" name="myFile" value="" multiple> <input type="submit" name="submit"> </form> Run the above, then use the file picker to attach 2+ files, then submit the form. Actual result: FORM.foo is list "one,three" and FORM.myFile is an array. Expected result: FORM.foo is array ["one","","three"] and FORM.myFile is an array. It should work regardless of input type. Thanks!, -Aaron
Comment by External U.
1503 | November 03, 2016 12:45:27 AM GMT