tracker issue : CF-4205066

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

[ANeff] ER for: Allow Array NoCase functions to search for any object case-insensitively

| View in Tracker

Status/Resolution/Reason: To Fix//Investigate

Reporter/Name(from Bugbase): Aaron N. / ()

Created: 08/28/2019

Components: Language, Functions

Versions: 2016,2018,14.0

Failure Type:

Found In Build/Fixed In Build: CF 2018, CF 2016 /

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 0

This ER is to allow Array NoCase functions to search for any object case-insensitively.

History: CF-3316776 was fixed incorrectly, IMO. Searching for complex objects should've been fixed instead of removed.

Suggestion: If the 2nd parameter to the Array NoCase functions isn't a callback, then they should do JSON comparisons.

Pseudo code, using ArrayFindNoCase() as an example:

numeric function ArrayFindNoCase(required array array, required any value) {
	var result = 0;
	for(var i=1; i<=ARGUMENTS.array.len(); i++) {
		if(serializeJSON(ARGUMENTS.array[i]) == serializeJSON(value)) {
			result = i;
			break;
		}
	}
	return result;
}

This would fix Array's NoCase functions to behave as always expected, b/c searching case-insensitively for a non-simple value is just as useful as searching for it case-sensitively.

Related tickets: CF-3316776, CF-3335956 and CF-4202901

Attachments:

Comments:

Another related ticket: CF-4202905
Comment by Aaron N.
31235 | August 28, 2019 07:17:14 AM GMT
Hi Aaron , We removed searching of complex objects back in Cf 2016 and have not got any request to get it back . Also , for searches like these we introduced the support of callbacks with all ArrayFind* , ArrayContains* & ArrayDelete* functions. Developers could use these callbacks for searching objects in an array. Please let us know if there is any strong usecase for supportingĀ  this. Thanks & Regards, Suchika
Comment by Suchika S.
31955 | December 11, 2019 11:38:05 AM GMT