Status/Resolution/Reason: To Fix//BugVerified
Reporter/Name(from Bugbase): Michael D. / ()
Created: 11/14/2019
Components: Language, Null Support
Versions: 2018
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: 2018,0,05,315699 /
Priority/Frequency: Normal / Most users will encounter
Locale/System: English / Win 2012 Server x64
Vote Count: 0
Problem Description:
isNull() fails to return the correct value when using a scoped query field. isNull() also fails when used within a cfif block when using a scoped query field.
Steps to Reproduce:
Enable null support in Application.cfc.
Perform a query (person) that returns a field (title) that contains null values in the records.
Issue 1:
Loop over the query results and display the result of isNull(person.title).
All results return "NO" even if the "title" field contains a non-null value.
<cfoutput query="person">
<p>
#isNull(person.title)#
</p>
</cfoutput>
Issue 2:
Loop over the query results and use isNull() in a cfif block.
The following code throws an exception.
<cfoutput query="person">
<p>
<cfif not isNull(person.title)>#person.title#</cfif>
</p>
</cfoutput>
Workaround That Solves Both Issues:
<cfoutput query="person">
<cfset thisTitle = person.title>
<p>
#isNull(thisTitle)#<br>
<cfif not isNull(thisTitle)>#thisTitle#</cfif>
</p>
</cfoutput>
The workaround may require that a significant amount of code be modified to use the isNull function.
Attachments:
Comments: