tracker issue : CF-4203055

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

ORM referencing non-existing arguments in cffunction

| View in Tracker

Status/Resolution/Reason: To Test//Investigate

Reporter/Name(from Bugbase): ALEXANDER HASS / ()

Created: 07/04/2018

Components: ORM Support

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: Updater 6 /

Priority/Frequency: Minor / All users will encounter

Locale/System: ALL / Win 2016

Vote Count: 0

Problem Description: The entityLoad function attempts to filter using all arguments from the calling cffunction, even if they were not passed to the function and no default argument value exists. In the test enclosed we attempt to load a user from the AdventureWorks table AFRUser by primary key however the sql attempts to filter by referencing the non-existing parameter in the calling function

Steps to Reproduce: Run attached repro case.

Actual Result: Crash

Expected Result: StructKeyExists(arguments,’Userlastname’) and IsDefined(‘arguments.userLastname’) both equal false. It is not logical for the entityLoad to attempt to reference those values. Either the argument exists but with a value of null, in which case we should see true by isdefined() and structkeyexists(), or the argument simply does not exist. If it does not exist, then the ORM should not attempt to filter by it.

Any Workarounds: the “arguments” structure being passed to entityload can be rebuilt to explicitly not include the unwanted missing argument. It is however not clear why this is necessary

Attachments:

Comments:

Hi Alexander, I am unable to repro this issue on ColdFusion 2016 Update 6. It is returning the record from the table, if I am passing arguments scope to the EntityLoad function. Can you please confirm ColdFusion build number? -Nimit
Comment by Nimit S.
29372 | July 05, 2018 09:42:58 AM GMT
CF 2016 Updater 6 Hotfixes: - chf20160006.jar - hf201600-0000000_EvalSoftReferences_v2.jar - hf201600-0000001_QueryOfQueryByAlphabeth.jar - hf201600-4198082_IDNA2003AndIDNA2008.jar
Comment by ALEXANDER H.
29464 | August 10, 2018 12:34:59 PM GMT