tracker issue : CF-4206329

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

After installing Update 13, component initialization fails

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): M M. / ()

Created: 12/11/2019

Components: Language, CF Component

Versions: 2016,2018

Failure Type: Non Functioning

Found In Build/Fixed In Build: 13 /

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Win 2016

Vote Count: 0

with the message clientID is undefined in ARGUMENTS.
The error is happening on this line:
return entityLoadByPK ("Client", {clientID = arguments.clientID});
Which is strange because in order to get to the line it needs to validate that the clientID exists and is > 0

Actual Result:

Steps to Reproduce:
public function init () output="false"	{
		if (structKeyExists (arguments, "clientID") && arguments.clientID > 0) 
			return entityLoadByPK ("Client", {clientID = arguments.clientID});
		else 
			return this;
	}


Expected Result:

Any Workarounds: 
adding curly brackets around the initialization code fixes the issue:
public function init () output="false"	{
		
		if (structKeyExists (arguments, "clientID") && arguments.clientID > 0) {
			return entityLoadByPK ("Client", {clientID = arguments.clientID});
		}
		else {
			return this;
		}
	}

Attachments:

Comments: