tracker issue : CF-3041783

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

Bug 83609:(Watson Migration Closure)[ANeff] Bug for: <cflogin /> within <cffunction /> creates variables

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 07/16/2010

Components: General Server

Versions: 11.0,10.0,9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 1

Problem:

[ANeff] Bug for: <cflogin /> within <cffunction /> creates variables.cflogin. When <cflogin /> is used within a function, it creates the cflogin struct as a key in the variables scope, instead of the function-local scope.Related thread: https://prerelease.adobe.com/r/?4e90c89e2c16465193be4bf7c4915825
Method:


Result:

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

Watson Bug ID:	3041783

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email: 3D1D17B03C844EBF992001AC
External Test Config: 07/16/2010

Attachments:

Comments:

This bug has been voted..
Vote by External U.
21693 | November 11, 2011 12:47:30 AM GMT
Adobe, I'm just checking-up on this. I see it's been nearly 5 years (still exists in CF11 Update 5). component { THIS.name = "ticket_CF-3041783"; THIS.sessionManagement = true; THIS.loginStorage = "session"; THIS.sessionTimeout = createTimeSpan(0,0,0,10); void function onRequest() { URL.j_username = "foo"; URL.j_password = "bar"; cflogin() { writeOutput(structKeyExists(local, "cflogin"));//returns NO (bug) writeOutput(structKeyExists(variables, "cflogin"));//returns YES (bug) } } } NotEnoughTime? This isn't an ER here. This is a scoping bug. When CF auto-gens vars w/in functions, they should be function-local-scoped by _default_. Is it possible to line this up for inclusion in a CF11 update? Thanks!, -Aaron
Comment by External U.
21685 | May 17, 2015 12:23:40 AM GMT
*bump*
Comment by External U.
21686 | September 12, 2015 02:59:55 AM GMT
Hi Adobe, This ticket's status can be changed from "Closed/ Deferred/NotEnoughTime" to "Closed/Fixed". I've verified this is fixed in CF2016 Final (build 2016.0.0.297996). This wasn't listed in the ColdFusion2016IssueFixed.pdf. It should be added to that PDF. Thanks!, -Aaron P.S. THIS.searchImplicitScopes=false breaks cflogin b/c the CFLOGIN struct never gets created (in any scope). I'll file another ticket for that.
Comment by External U.
21687 | October 29, 2016 02:28:58 PM GMT
Just filed related ticket: CF-4197151
Comment by External U.
21688 | October 29, 2016 03:41:05 PM GMT
Thanks Aaron for verifying it. We will get it verified and close it.
Comment by Nimit S.
21689 | October 29, 2016 10:03:54 PM GMT
Hi Nimit, You're very welcome! Here is the code I used to verify: Application.cfc ---------------------- component { THIS.name = "ticket_CF-3041783"; THIS.sessionManagement = true; THIS.loginStorage = "session"; THIS.sessionTimeout = createTimeSpan(0,0,0,10); void function onRequest() { URL.j_username = "foo"; URL.j_password = "bar"; cflogin() { writeOutput(structKeyExists(local, "cflogin")); writeOutput(structKeyExists(variables, "cflogin")); } } } index.cfm ---------------------- [empty file] Before CF2016, result was NOYES (bad) In CF2016, result is YESNO (good - bug is fixed) Thanks!, -Aaron
Comment by External U.
21690 | October 30, 2016 01:28:02 AM GMT
Hi Aaron, The fix would be available in the upcoming updates for CF11. Thanks, Preethi
Comment by S P.
21691 | November 03, 2016 05:34:29 AM GMT
Hi Preethi, Thanks for also working on a CF11 fix! Very cool. -Aaron
Comment by External U.
21692 | November 03, 2016 12:52:22 PM GMT