tracker issue : CF-3506225

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

argumentcollection bugs with numeric keys

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Dale Fraser / Dale Fraser (dalefraser)

Created: 02/25/2013

Components: General Server

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 2

Related Bugs:
CF-3508651 - Similar to


Problem Description:

Passing an argument collection to a function with numeric keys results in data being swapped and / or unable to be dumped.

Steps to Reproduce:

<cfset local.args = { 'id' = '23', '1' = '2', '3' = '4' } />
<cfdump var="#local.args#" label="args" />
<cfset testCase(argumentCollection = local.args) />

<!--- Case 2 --->
<cfset local.args = { '1' = '2', '3' = '4' } />
<cfdump var="#local.args#" label="args" />
<cfset testCase(argumentCollection = local.args) />

<cffunction name="testCase">
        <cfdump var="#arguments#" />
</cffunction>

Actual Result:

Case 1
Values have changed

Case 2
Errors attempting to dump values

Expected Result:

Case 1
Value's shouldn't be changed

Case 2
Value should be able to be dumped

Any Workarounds:
None

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

Watson Bug ID:	3506225

External Customer Info:
External Company:  
External Customer Name: dalefraser
External Customer Email:  
External Test Config: Windows 7, IIS, other community users have same issue with cf8 & cf9

Attachments:

Comments:

This seems like rather a fundamental thing to be getting wrong by the time we're @ CF version *10*. Obviously needs to be fixed. -- Adam
Vote by External U.
16193 | February 25, 2013 09:49:26 PM GMT
+1 This needs to be fixed.
Vote by External U.
16194 | February 26, 2013 12:33:21 AM GMT
Function argument name CANNOT be a number. To me, numeric key as the function parameter name does not make any sense and therefore it wouldn't make any sense to support numeric keys for argumentCollection. Numeric keys are very much possible for struct and that can be passed directly to the function. Closing this bug as invalid.
Comment by Rupesh K.
16191 | September 04, 2013 08:52:55 AM GMT
Regarding the "Errors attempting to dump values", I see the "Variable KEYVALUE is undefined." error was fixed in CF11. In CF10, I see writeDump() was throwing that error if any of the middle keys were missing in a numerically-key'd struct. Example (throws error in CF10 b/c middle key "2" is missing): <cfscript> function f() {return arguments;} args = {"1"="foo", "3"="bar"}; writeDump(f(argumentCollection=args)); </cfscript> But this works in CF10: <cfscript> function f() {return arguments;} args = {"1"="foo", "3"="bar", "2"="foobar"}; writeDump(f(argumentCollection=args)); </cfscript> Thanks!, -Aaron
Comment by External U.
16192 | November 24, 2015 07:38:32 PM GMT