tracker issue : CF-3341284

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

Variable half-disappears from struct after added, but only if first calling a function with argumentcollection=arguments

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Paul Karlin / Paul Karlin (Paul Karlin)

Created: 10/04/2012

Components: Language

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final / 284806

Priority/Frequency: Major / All users will encounter

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

Vote Count: 8

Problem Description:
We have a large base of code that used to work fine in CF8.0.1 and we are trying to upgrade to CF10.  Here is a simplified example that will work in a stand-alone CFM file (also attached as debug.cfm):

<cffunction name="innerTest" access="public" output="true" returntype="void">
	<cfset var ls = {} />
	
	<cfset ls.argsGood = StructCopy(arguments) />
	<cfset dummyTest(argumentcollection=arguments) />
	<cfset ls.argsBad = StructCopy(arguments) />
	<cfset ls.argsGood.d = arguments.c />
	<cfset ls.argsBad.d = arguments.c />
	
	<cfoutput>
	inner args: ls.argsGood.d = #ls.argsGood.d#
	<cfdump var="#ls.argsGood#"/>
	ls.argsBad.d = #ls.argsBad.d#
	<cfdump var="#ls.argsBad#"/>
	</cfoutput>
	
</cffunction>

<cffunction name="dummyTest" access="public" output="false" returntype="void">
</cffunction>

<cfset innerTest(a="1",b="2",c="3")/>

Steps to Reproduce:
Place debug.cfm anywhere under ColdFusion's web root and retrieve it from your browser.

Actual Result (in CF10):
inner args: ls.argsGood.d = 3
struct
D	 3
a	 1
b	 2
c	 3
ls.argsBad.d = 3
struct
a	 1
b	 2
c	 3

Expected Result (actual result in CF8):
inner args: ls.argsGood.d = 3
struct
D	 3
a	 1
b	 2
c	 3
ls.argsBad.d = 3
struct
D	 3
a	 1
b	 2
c	 3

Any Workarounds:
Rewrite hundreds of lines of our working CF8 code to avoid calling functions with argumentcollection=arguments before using StructCopy.

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

Watson Bug ID:	3341284

Keywords:
FixTested


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

Windows 7 Enterprise or 2008R2 Web/Standard Edition, 64-bit CF10, 64-bit JDK1.6.0_31, connected via IIS

Attachments:

  1. October 05, 2012 00:00:00: 1_debug.cfm

Comments:

This bug will force me to rewrite large sections of the codebase. I believe that this is a fairly basic flaw in the CFML language. Thanks!
Vote by External U.
17735 | October 04, 2012 04:33:04 PM GMT
+1 this is also a bug in CF9. CF8 is fine.
Vote by External U.
17736 | October 05, 2012 02:59:16 AM GMT
This is a fundamental problem with CFML that worked in CF8, but unfortunately Adobe is ending support of CF8, forcing people to upgrade to a version in which this is now broken.
Vote by External U.
17737 | October 05, 2012 06:26:00 AM GMT
I feel this is fairly basic functionality that is there in CF8 and since it made the code more elegant we used it a lot. Now we will have to rewrite large chunks of code with minimal gain if any
Vote by External U.
17738 | October 05, 2012 07:00:38 AM GMT
This is blocking our upgrade and would take unnecessary engineering time to fix.
Vote by External U.
17739 | October 05, 2012 07:56:41 AM GMT
+1 this is basic language functionality that is not working as documented. It is also a regression in the language that may discourage CF8 users from wanting to upgrade ColdFusion, thereby exposing them to critical security flaws in CF8 that Adobe will no longer be patching. http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WS932f2e4c7c04df8f5f042e6e13586b58526-7ffe.html http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f09.html
Vote by External U.
17740 | October 05, 2012 07:59:51 AM GMT
We are unable to upgrade our CF without investing additional engineering time to hack together a fix for something that should not be broken.
Vote by External U.
17741 | October 05, 2012 12:44:22 PM GMT
We've seen this in CF9.0.1 as well. Requires rewrites, which is waste of our team's time.
Vote by External U.
17742 | October 09, 2012 06:43:41 AM GMT