tracker issue : CF-3991492

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

cfloop list index value isn't updated

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 05/20/2015

Components: Language

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Linux Ubuntu 10.10

Vote Count: 0

Problem Description:
When looping over an list you can get the problem that the vale in the index isn't updated for each iteration. It remains the value that it got for the first time. 

Steps to Reproduce:
<cffunction name="test" >
	<cfset var key = javacast("null", 0) />
	<cfset keyList = "key1, key2, key3, key4" />
	
	<cfloop list="#keyList#" index="key">
		<cfoutput>#key#</cfoutput>
	</cfloop>
</cffunction>

<cfset test() />

Actual Result:
value of key remains key1

Expected Result:
value of key is updated for each iteration

Any Workarounds:
1) instead of using index "key" use "local.key"
2) delete index declaration before loop

Seems to work correctly in CF11. Didn't test it for cfscript.

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

Watson Bug ID:	3991492

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

Ubuntu 12.04,  CF10,0,15,292620

Attachments:

Comments:

verified with coldfsuion 10(mendatory fix+ update 16), issue persists. Should be fixed in HF17.
Comment by Poonam J.
7378 | June 05, 2015 06:42:02 AM GMT
Fixed in CF11. Fix available in all the later release.
Comment by Awdhesh K.
7379 | August 18, 2015 06:22:11 AM GMT
Still not fixed in CF10 update 18 (10,0,18,296330)
Comment by External U.
7380 | November 30, 2015 03:37:50 AM GMT
Hi Awdhesh, Which CF11 update was this fixed in? Thanks!, -Aaron
Comment by External U.
7381 | December 19, 2015 02:51:43 AM GMT