tracker issue : CF-4198613

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

Argument variable with elvis operator crashes inside cffunction

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Tim Soslow / Tim Soslow ()

Created: 05/08/2017

Components: Language, CF Component

Versions: 2016

Failure Type: Crash

Found In Build/Fixed In Build: Update 4 -- 2016.0.04.302561 /

Priority/Frequency: Normal / All users will encounter

Locale/System: / Linux Ubuntu 14.04

Vote Count: 0

Problem Description:
  When using Elvis Operator in combination with accessing a value in a struct using a dynamically constructed string using an Argument variable, the page crashes saying that the Argument does not exist. This happens regardless of passing the argument into the method or giving the argument a default value. 

Steps to Reproduce:
  See uploaded ElvisArgument.cfc file. Calling the getData() function will trigger the crash. The getDataSetKey() and getDataNoElvis() functions are similar but do not cause a crash. This does not crash ColdFusion 2016 Updater 3 and earlier. Updater 4 introduces this crash.

Actual Result:
  Crashes with message "Element KEY is undefined in ARGUMENTS" even though it is actually defined in Arguments.

Expected Result:
  Should return computed key's value from the struct if it exists, otherwise return the Elvis Operators default value.

Any Workarounds:
  Do not upgrade to Update 4
  Set the structure key in a variable before hand (workaround 1 in code)
  Use if/else StructKeyExists instead of Elvis Operator (workaround 2 in code)

Attachments:

  1. May 08, 2017 00:00:00: ElvisArgument.cfc

Comments:

This bug is a duplicate of bug https://tracker.adobe.com/#/view/cf-4198559. Hence closing this.
Comment by Suchika S.
795 | June 12, 2017 06:09:56 AM GMT