tracker issue : CF-3815793

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

structcopy doens't return a copy

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Jork Zijlstra / Jork Zijlstra (Jork Zijlstra)

Created: 09/01/2014

Components: Language, Datastructure

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final / CF11 Update5

Priority/Frequency: Minor / All users will encounter

Locale/System: English / Linux Ubuntu 10.10

Vote Count: 3

Listed in the version Issues Fixed doc
Problem Description:
Structcopy doesn't return a copy for FORM or URL. We expect Session to do the same

Steps to Reproduce:
1) do a form post
2) make a structcopy
3) update form key of copy
4) dump / output form

Actual Result:
Form scope has been altered

Expected Result:
Form scope isn't altered

Any Workarounds:
use duplicate instead of structcopy

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

Watson Bug ID:	3815793

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

CF9 and CF10


  1. September 02, 2014 00:00:00: 1_sanitize.cfm


+1 ///////////////////////////
Vote by External U.
11193 | September 01, 2014 03:56:36 AM GMT
This happens back to at least CF9.
Comment by External U.
11179 | September 01, 2014 03:56:46 AM GMT
Please provide code to repro the case.
Comment by Akhila K.
11180 | September 01, 2014 11:43:36 PM GMT
What, this wasn't clear enough: Steps to Reproduce: 1) do a form post 2) make a structcopy 3) update form key of copy 4) dump / output form ?? That's exactly what I did for my testing, and it clearly demonstrates the issue. What code did YOU try? How about you demonstrate some effort in understanding the issue, rather than fall back to us doing your work for you? (that said, let me dish out the code... in the mean time, pls post how you'd been trying to repro it, I'm fascinated to see how you *couldn't* repro this). -- Adam
Comment by External U.
11181 | September 02, 2014 01:55:54 AM GMT
For some reason the file wan't attached when creating this issue I added the test case for Form submit and url.
Comment by External U.
11182 | September 02, 2014 03:18:15 AM GMT
Thanks Jork for attaching the code snippet promptly
Comment by Vamseekrishna N.
11183 | September 02, 2014 07:19:30 AM GMT
The repro can be a lot simpler than that. See large spiel here: And very simple repro: <cfscript> // urlBug.cfm URL.testKey = "value set in URL scope"; copy = structCopy(URL); copy.testKey = "value set in copy"; writeDump(var=URL, label="URL scope after change made to copy"); </cfscript>
Comment by External U.
11184 | September 02, 2014 07:39:39 AM GMT
I see that I indeed uploaded the complex version. In the end we simplified it to the version that you described. Thanks for the simple version. Form and Url scope both have this problem. Since the session scope is also not really a struct we expect it to have the same problem.
Comment by External U.
11185 | September 02, 2014 08:03:36 AM GMT
Ran into this bug, and had to work around it.
Vote by External U.
11194 | November 06, 2014 06:16:04 AM GMT
+1 ......................
Vote by External U.
11195 | November 24, 2014 01:54:13 AM GMT
FFS. If you're going to mark something as "fixed", can you pls tell us WHICH VERSION IT'S FIXED IN! One version it is NOT fixed in is 11,0,03,292480. Which is the most current version of CF publically available, as far as I know? So which version IS it fixed in? And how is it that I need to actually ask this question??! -- Adam
Comment by External U.
11186 | December 15, 2014 09:47:04 AM GMT
The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
11187 | February 20, 2015 09:26:35 AM GMT
Verified this is fixed in CF11 Update 5 (build 11,0,05,293506). Thanks!, -Aaron
Comment by External U.
11188 | November 20, 2015 06:28:47 AM GMT
Not fixed in CF10 Update 18 (10,0,18,296330 )
Comment by External U.
11189 | November 23, 2015 02:57:05 AM GMT
This was raised against ColdFusion 10, so fixing it in ColdFusion 11 is not good enough.
Comment by External U.
11190 | November 23, 2015 03:00:39 AM GMT
+1 to Adam's comment. StructCopy() should also work properly on CF10. Thanks!, -Aaron
Comment by External U.
11191 | November 23, 2015 04:15:57 AM GMT
+1. You said it, it just weird to fix a bug in a version that is wasn't raised at.
Comment by External U.
11192 | November 23, 2015 04:33:21 AM GMT