tracker issue : CF-4028246

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

isNull() just doesn't work

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 07/30/2015

Components: Language

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Most users will encounter

Locale/System: ALL / Platforms All

Vote Count: 20

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 24, 2019 using build 2016.0.01.298513
Steps to Reproduce:
areAllNull = isnull(request) && isnull(server) && isnull(form) && isnull(url) && isNull({}) && isnull(33);

writeOutput("
isnull(request): #isnull(request)#<br>
isnull(server): #isnull(server)#<br>
isnull(form): #isnull(form)#<br>
isnull(url): #isnull(url)#<br>
isnull(33): #isnull(33)#<br>
isNull({}): #isNull({})#<br>
areAllNull: #areAllNull#<br>
");

Actual Result:
isnull(request): YES
isnull(server): YES
isnull(form): YES
isnull(url): YES
isnull(33): YES
isNull({}): NO
areAllNull: NO

Expected Result:
isnull(request): false
isnull(server): false
isnull(form): false
isnull(url): false
isnull(33): false
isNull({}): false
areAllNull: false

Any Workarounds:
Use Lucee. It works.

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

Watson Bug ID:	4028246

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

Attachments:

Comments:

Well wow.............................
Vote by External U.
6426 | July 30, 2015 03:03:37 AM GMT
I think there might be a problem here.................
Vote by External U.
6427 | July 30, 2015 04:37:15 AM GMT
FFS Adobe... Give it up. Give us true null support. You're obviously incapable of getting this weird sorta-null support right.
Vote by External U.
6428 | July 30, 2015 06:44:45 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing.
Vote by External U.
6429 | July 30, 2015 07:45:32 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing.
Vote by External U.
6430 | July 30, 2015 07:50:47 AM GMT
So looking at this I am going to venture a guess that the current implementation of isNull() is looking at variables.request when it is evaluating isNull(request) and not the request scope which would be expected. adding isnull(variables.request): #isnull(variables.request)# to the block results in "YES" which seems to confirm this.
Comment by External U.
6418 | July 30, 2015 09:03:38 AM GMT
This needs to be fixed. isNull() should be aware of the various scopes.
Vote by External U.
6431 | July 30, 2015 09:04:10 AM GMT
ColdFusion 10 (and 8/9) all currently return the same invalid results. This should be fixed in all supported versions and not be dismissed because it will "break backward compatibility". I reported a similar isNull issue 2 years ago for CF9 (open/NeedsReview): https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3556075 Something similar was also reported for CF8 about 9 years ago (closed/NotEnoughTime): https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3027425
Comment by External U.
6419 | July 30, 2015 09:53:35 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing.
Vote by External U.
6432 | July 30, 2015 10:59:41 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing. I'm unoriginal, sue me. ;-)
Vote by External U.
6433 | July 30, 2015 02:00:09 PM GMT
My vote My My My My My vote My My My My vote
Vote by External U.
6434 | July 31, 2015 02:13:07 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing.
Vote by External U.
6435 | July 31, 2015 12:24:06 PM GMT
+1 .........................................
Vote by External U.
6436 | August 01, 2015 11:55:18 AM GMT
#isnull(33)# will be YES, the behavior is in sync with isDefined. Others are fixed now, isNull(request) will return NO.
Comment by Milan C.
6420 | September 24, 2015 03:58:54 AM GMT
Milan, 33 is not null. It doesn't matter what isDefined() does: isDefined() is for checking if a variable exists. isNull() is to check whether the expression is null. The purposes of the functions *is really easy to tell from their names*.
Comment by External U.
6421 | September 24, 2015 04:01:27 AM GMT
This should be fixed. Nearly all languages have full NULL support adn ColdFusion continues with this half baked version that makes no sense
Vote by External U.
6437 | September 24, 2015 07:17:20 AM GMT
At least now I know where to point when someone asks me to give an example of ineptitude.
Comment by External U.
6422 | September 24, 2015 07:52:50 AM GMT
25 characters here because the bug tracker still won't let me vote for something without typing.
Vote by External U.
6438 | September 24, 2015 07:59:33 AM GMT
As already stated: 33 is not null. It doesn't matter what isDefined() does: isDefined() is for checking if a variable exists. isNull() is to check whether the expression is null. The purposes of the functions *is really easy to tell from their names*.
Vote by External U.
6439 | September 24, 2015 08:59:48 AM GMT
Me: Magic 8 ball, should this get fixed? ............... .............. Magic 8 ball: My sources say #isNull(33)#....
Vote by External U.
6440 | September 24, 2015 10:15:39 AM GMT
Wow, just caught up on this one. And people wonder why we are frustrated with the "leadership" of Adobe on the product we used to love so much. To not even understand the concept of Null in a programming language is shocking to say the least.
Comment by External U.
6423 | September 24, 2015 11:03:53 AM GMT
I also think 33 should be demoted from "number" to "nothing." Also, it looks like a couple of butts, which offends my old-fashioned values.
Vote by External U.
6441 | September 24, 2015 12:56:27 PM GMT
I am pleased to explain in 25 characters or more how this bug impacts productivity and why I am adding a vote.
Vote by External U.
6442 | September 24, 2015 03:20:31 PM GMT
Where do I go to find out if 33 exists?
Vote by External U.
6443 | September 24, 2015 04:37:07 PM GMT
Do we REALLY have to continue to argue with Adobe over what NULL means??? A concept that exists in virtually every other language and means the same thing in ALL of them. Except for ColdFusion.
Vote by External U.
6444 | September 24, 2015 05:46:04 PM GMT
isNull is not working with literals like string, boolean or number. This is a valid case and we have logged a separate bug to track it, bug#CF-4063717.
Comment by Milan C.
6424 | September 25, 2015 12:38:48 AM GMT
+1 ......................
Vote by External U.
6445 | September 28, 2015 02:27:51 AM GMT
Just noting that CF-4063717 (referenced in previous comment) is now Closed/Withdrawn/AsDesigned. A new ticket was created: CF-4183352. Thanks!, -Aaron
Comment by External U.
6425 | August 29, 2016 02:10:26 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). With scope lookup enabled, isNull(SCRIPT_NAME) returns NO whereas CF11 returned YES. And isNull(33) returns NO if a variable named 33 exists in the scope lookup. However, regardless, isNull("33") always returns YES b/c CF-4183352 was marked Closed/Withdrawn/AsDesigned w/o explanation. Thanks!, -Aaron
Comment by Aaron N.
31168 | August 24, 2019 02:32:08 AM GMT