Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 05/20/2018
Components: Language, Null Support
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) / 2018,0,0,309819
Priority/Frequency: Normal / Most users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: cannot assign null to variables in some scopes from CFC
Steps to Reproduce:
1) Enable NULL support
2) Create Application.cfc having:
-----------
component {
THIS.name = "MyApp"
THIS.applicationTimeout = createTimeSpan(0,0,0,10)
THIS.sessionManagement = true
THIS.sessionTimeout = createTimeSpan(0,0,0,10)
THIS.enableNULLSupport=true
}
-----------
3) Create MyCFC.cfc having:
-----------
component {function f() {FORM.foo = null}}
-----------
4) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(FORM.foo))
</cfscript>
-----------
Actual and Expected Result: YES
5) In MyCFC.cfc, change FORM.foo to URL.foo
6) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(URL.foo))
</cfscript>
-----------
Actual and Expected Result: YES
7) In MyCFC.cfc, change URL.foo to SERVER.foo
8) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(SERVER.foo))
</cfscript>
-----------
Actual and Expected Result: YES
9) In MyCFC.cfc, change SERVER.foo to REQUEST.foo
10) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(REQUEST.foo))
</cfscript>
-----------
Actual Result: coldfusion.runtime.UndefinedElementException: Element FOO is undefined in a Java object of type class coldfusion.runtime.RequestScope.
Expected Result: YES
11) In MyCFC.cfc, change REQUEST.foo to SESSION.foo
12) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(SESSION.foo))
</cfscript>
-----------
Actual Result: coldfusion.runtime.UndefinedElementException: Element FOO is undefined in a Java object of type class coldfusion.runtime.MemorySessionScope.
Expected Result: YES
13) In MyCFC.cfc, change SESSION.foo to APPLICATION.foo
14) Run index.cfm containing:
-----------
<cfscript>
invoke("MyCFC", "f")
writeDump(isNULL(APPLICATION.foo))
</cfscript>
-----------
Actual Result: coldfusion.runtime.UndefinedElementException: Element FOO is undefined in a Java object of type class coldfusion.runtime.ApplicationScope.
Expected Result: YES
Related post: http://blog.cfaether.com/2018/05/cannot-assign-null-to-variables-in-some.html
Attachments:
Comments: