tracker issue : CF-4126393

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

cfloop over a function local scope query ends iteration early

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Darren Pywell / Darren Pywell (dapywell)

Created: 03/09/2016

Components: Language

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: RC1_v12 /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Mac All

Vote Count: 2

Listed in the version 2016.0.01.298513 Issues Fixed doc
Verification notes: verified_fixed on September 29, 2019 using build 2016.0.01.298513
Problem Description:
When using a cfloop to iterate over a query that has been defined as a var function local, the iteration ends early if the function local variable is used in recursive way.

The behaviour has been tested against ColdFusion 10,11 and 2016. CF10 and 11 output the expected result using the same file.

Steps to Reproduce:
Run the attached page

Actual Result:
/root/1
/root/1/1

Expected Result:
root/1
/root/1/1
/root/2
/root/2/2
/root/3
/root/3/3
/root/4
/root/4/4
/root/5
/root/5/5
/root/6
/root/6/6
/root/7
/root/7/7
/root/8
/root/8/8
/root/9
/root/9/9
/root/10
/root/10/10

Any Workarounds:
None

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

Watson Bug ID:	4126393

External Customer Info:
External Company: Intergral
External Customer Name: Darren Pywell
External Customer Email: DARREN_PYWELL@INTERGRAL.COM
External Test Config:  


Bug File Paths:
\\sjshare.corp.adobe.com\Prereleasebugfiles\ColdFusion\12.0\RC1_v12\4115255\test.cfdirectory.cfm

Attachments:

Comments:

Adding BUG AUDIT TRAIL ********action: updated fieldName: Status newValue: ToTest oldValue: ToFix oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Reason newValue: Fixed oldValue: BugVerified oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Changelist newValue: 298099 oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Owner newValue: inoel oldValue: sanniset oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Fixed By newValue: sanniset oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Date Fixed newValue: 2016-03-03 04:43:20.0 oldValue: Blank oprid: sanniset recordName: RQ_DEFECT timpestamp: 2016-03-03 12:43:20.0 action: updated fieldName: Dev Assigned newValue: sanniset oldValue: awdhesh oprid: awdhesh recordName: RQ_DEFECT timpestamp: 2016-03-03 12:41:38.0 action: updated fieldName: Owner newValue: sanniset oldValue: awdhesh oprid: awdhesh recordName: RQ_DEFECT timpestamp: 2016-03-03 12:41:38.0 action: updated fieldName: Fix By Product Milestone newValue: HF1 oldValue: Alpha oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-29 12:48:48.0 action: updated fieldName: Fix By Milestone newValue: Post Release oldValue: Alpha oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-29 12:48:48.0 action: updated fieldName: Severity newValue: 3 oldValue: 4 oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-16 05:17:08.0 action: updated fieldName: Severity newValue: 4 oldValue: 4 oprid: hkallae recordName: RQ_DEFECT timpestamp: 2016-02-12 05:20:48.0 action: updated fieldName: Priority newValue: 3 oldValue: 0 oprid: hkallae recordName: RQ_DEFECT timpestamp: 2016-02-12 05:20:48.0 action: updated fieldName: Owner newValue: awdhesh oldValue: inoel oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:56:23.0 action: updated fieldName: Fix By Milestone newValue: Alpha oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:56:23.0 action: updated fieldName: Status newValue: ToFix oldValue: Unverified oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:56:23.0 action: updated fieldName: Fix By Product Milestone newValue: Alpha oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:56:23.0 action: updated fieldName: Reason newValue: BugVerified oldValue: Blank oprid: suchsing recordName: RQ_DEFECT timpestamp: 2016-02-09 09:56:23.0
Comment by CFwatson U.
4281 | March 09, 2016 01:55:03 AM GMT
Added By: PreRelease User User Name:Darren Pywell Note Added: Entered Bug. Date Added :2016-02-09 00:48:17.0
Comment by CFwatson U.
4282 | March 09, 2016 01:55:04 AM GMT
This issue popped up on the forums today: https://forums.adobe.com/thread/2132988. Can we get an idea when the fix for this will be released (in the forthcoming Update 1 or not)?
Comment by External U.
4283 | April 05, 2016 02:34:43 PM GMT
Starting to affect other users as well.
Vote by External U.
4286 | April 05, 2016 02:35:57 PM GMT
My custom CMS stopped working when I upgraded to 2016.
Vote by External U.
4287 | April 05, 2016 03:24:54 PM GMT
It will be released in Update 1 which is due very soon.
Comment by Vamseekrishna N.
4284 | April 06, 2016 11:48:28 PM GMT
Hi All, I'm sorry this wasn't mentioned earlier on this thread, but the answer is in the Release Notes. CF2016's Release Notes (https://helpx.adobe.com/coldfusion/release-note/coldfusion-2016-release-notes.html) mentions this specific issue and its temporary workaround: JVM argument -Dcoldfusion.udf.reuseTagInstances=false I've confirmed that workaround resolves this issue, using the following code which displays incorrect result in CF2016 final unless using that JVM argument: <cfset myQuery = queryNew("parentID,title,sitePageID,priority", "", [[0,"Item 1",1,1],[0,"Item 2",2,2],[2,"Sub 1",3,3],[2,"Sub 2",4,4],[0,"Item 3",5,5],[0,"Item 4",6,6]])> <cffunction name="doThis" access="public" returntype="string"> <cfargument name="parent" type="numeric" default="0"> <cfquery name="LOCAL.q" dbtype="query"> SELECT parentID, title, sitePageID FROM variables.myQuery WHERE parentID = <cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.parent#"> ORDER BY priority </cfquery> <cfsavecontent variable="LOCAL.html"> <ul> <cfoutput query="LOCAL.q"> <li> <span>#LOCAL.q.title#</span> #doThis(parent=LOCAL.q.sitePageID)# </li> </cfoutput> </ul> </cfsavecontent> <cfreturn LOCAL.html> </cffunction> <cfoutput>#doThis()#</cfoutput> Thanks!, -Aaron P.S. Please note that JVM argument is the workaround for a few tickets and should've been part of CF2016's final build.
Comment by External U.
4285 | April 24, 2016 02:07:12 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
31452 | September 29, 2019 05:56:36 AM GMT