tracker issue : CF-3952818

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

[elvis] [peter]: elvis operator returns second operand in some cases even if the first operand is not null

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): / ext-user (Suchika Singh)

Created: 03/13/2015

Components: Language

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF 11 Final / 2016.0.0.298074

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win XP All

Vote Count: 12

Listed in the version 2016.0.0.297996 Issues Fixed doc
Problem:elvis operator returns second operand in some cases even if the first operand is not null

Method:Run the following code:
<cfset a={name="suchi",age="23"}>
<cfset b="name">
<cfoutput>#a[b]?:'n/a'#</cfoutput>

Result:n/a

Expected:suchi

Workaround:

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

Watson Bug ID:	3952818

External Customer Info:
External Company:  
External Customer Name:  
External Customer Email:

Attachments:

Comments:

[subscribe] Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and 4000 characters Vote must be between 25 and
Vote by External U.
8074 | March 14, 2015 04:55:19 AM GMT
This bug is 5 months old. When will it be fixed?
Comment by External U.
8064 | August 09, 2015 11:18:28 AM GMT
The Elvis operator will not work when a variable is placed within the square brackets like so: <cfset Name = "Neil"> <cfset VariableName = "Name"> <cfset Hello = "Hello " & (Variables[Variables.VariableName] ?: "you")> <cfoutput>#Variables.Hello#</cfoutput> Which should return "Hello Neil" but incorrectly returns "Hello you"
Vote by External U.
8075 | August 09, 2015 11:23:54 AM GMT
........................................................
Vote by External U.
8076 | September 30, 2015 04:21:09 PM GMT
This fix will be available in the next major version of ColdFusion.
Comment by Suchika S.
8065 | October 26, 2015 06:47:58 AM GMT
+1 - It looks like this was filed a year ago as part of CF-3840570. If so, this should be fixed in CF11.
Vote by External U.
8077 | November 21, 2015 06:33:57 AM GMT
When is this getting fixed for CF11?
Comment by External U.
8066 | February 24, 2016 05:19:45 AM GMT
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................(TRUNCATED)
Vote by External U.
8078 | February 24, 2016 05:19:56 AM GMT
The elvis should function as a shortcut for "isDefined('first')?first:second". It doesn't. This is a bug. It can't wait a year (or two) for the next feature release.
Vote by External U.
8079 | February 24, 2016 07:24:49 AM GMT
The fix should be backported to CF11 where the bug first appeared.
Vote by External U.
8080 | February 24, 2016 10:48:16 AM GMT
I vote that this bug fix gets pushed into CF11
Vote by External U.
8081 | March 02, 2016 12:50:25 PM GMT
So according to a post on the Adobe forums related to this bug (https://forums.adobe.com/message/8557086#8557086), Adobe will not be back-porting the fix from ColdFusion 2016 to ColdFusion 11 (where the bug originated). It seems there is too much internal plumbing that had to be fixed in order to resolve the bug, and those plumbing changes are too difficult to push back to ColdFusion 11. Bottom line: anyone who can't upgrade to ColdFusion 2016 (for whatever reason) is just out of luck. Adobe - if you can't make it work in ColdFusion 11, this needs to be well-documented to warn users not to use it in ColdFusion 11.
Comment by External U.
8067 | March 03, 2016 10:59:20 AM GMT
And how is it no-one from *Adobe* fronted up with that information? Why did it take someone from the community (thanks Carl, btw). I don't believe there can be such reach with this bug (which is in a new feature to only the previous version of CF) that it cannot be fixed in CF11 as well. For one thing... if it was so complicated and far-reaching they'd never have implemented this feature in the first place. If the fix can't be backported, due to architectural changes (according to the forum post), then it can simply be fixed again in CF11. People have already paid you for this to not be broken. You need to fix bugs in the version they were raised in, if that version is still actively supported. Which CF11 is. Own your mistakes, Adobe.
Comment by External U.
8068 | March 03, 2016 05:10:06 PM GMT
Why is ColdFusion 11 even supported? Why not just mark it as End of Life and kill if off if you are refusing to fix bugs? It seems Adobe has a different definition of "Support" than the rest of the world.
Comment by External U.
8069 | March 03, 2016 05:18:33 PM GMT
+1...............................
Vote by External U.
8082 | March 08, 2016 07:31:00 AM GMT
This is why developers are getting fed up with the product.
Comment by External U.
8070 | March 08, 2016 07:31:23 AM GMT
Another +1 from me. <<<<< So apparently I no longer have to enter a minimum number of characters. Adobe will do it for me. How about just not have a minimum for voting at all. Or require a comment. But instead of beating a dead horse, (OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Please explain in 25 characters or more how this bug impacts productivity and why you are adding a vote.(OPTIONAL) Pleas(TRUNCATED)
Vote by External U.
8083 | March 08, 2016 07:34:30 PM GMT
It is unacceptable that this is marked 'Fixed' when the actual status (found only by plumbing through the tracker) is 'Fixed in ACF2016, won't fix in ACF11.'
Comment by Samuel K.
8071 | July 20, 2017 03:42:38 PM GMT
Hi Adobe, Please populate "Fixed In Build". Currently it is NULL. I concur w/ the others. Knowingly 1) leaving broken behavior in supported version and 2) not *at least* documenting it as a "Known Issue" is double-wrong. This ticket was not closed-out properly and needs reviewed again. Thanks!, -Aaron
Comment by Aaron N.
8072 | July 20, 2017 05:17:01 PM GMT
Hello , We are sorry that we didnt update the "fixed in build" information. Ihave entered the information now. Going forward we will take care that we enter this information before we close the bug. Thanks, Suchika
Comment by Suchika S.
8073 | July 21, 2017 06:22:52 AM GMT
This is one of the reasons the ColdBox framework still cannot use elvis. We need to support CF11 and bugs like this make it unusable.
Comment by Bradley W.
29279 | July 11, 2018 05:31:07 AM GMT