tracker issue : CF-4202901

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

[ANeff] Bug for: some array searching functions are type-checking the haystack

| View in Tracker

Status/Resolution/Reason: To Test//Fixed

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 06/18/2018

Components: Language, Functions

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.0.310409 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: some array searching functions are type-checking the haystack

Repro:
{code:java}
<cfscript>
  haystack = [true,1,createDate(2018,1,1),"foobar",{foo="Bar"},function(){return true}]
  arrayFind(haystack, "asdf")//no error (good)
  arrayFindNoCase(haystack, "asdf")//throws '"Valid datatypes in array are String|Boolean|Number. "' (bad)
  arrayFindAll(haystack, "asdf")//no error (good)
  arrayFindAllNoCase(haystack, "asdf")//no error (good)
  arrayContains(haystack, "asdf")//no error (good)
  arrayContainsNoCase(haystack, "asdf")//throws '"Valid datatypes in array are String|Boolean|Number. "' (bad)
  arrayDelete(haystack, "asdf")//no error (good)
  arrayDeleteNoCase(haystack, "asdf")//throws '"Valid datatypes in array are String|Boolean|Number. "' (bad)
</cfscript>
{code}


Actual Result: The Array_(haystack, "needle") functions can find "needle" in any haystack, except for arrayFindNoCase(), arrayContainsNoCase() and arrayDeleteNoCase()

Expected Result: The Array_(haystack, "needle") functions can find "needle" in any haystack.

These functions must perform on any haystack. These are not typed-array-checking functions; that is the domain of isValid().

Attachments:

Comments:

ArrayFindNocase would only search for strings,number and boolean. This was changed as part of bug :  [https://tracker.adobe.com/#/view/CF-3316776] We will fix ArrayFindAllNoCase to only search for strings,number and boolean. This will maintain consistency.
Comment by Suchika S.
29141 | June 28, 2018 12:35:55 PM GMT
Hi Suchika, Just a note that implementing CF-4205066 would make this ticket irrelevant. Could you please, please consider CF-4205066 from the viewpoint of what'd be most useful behavior for developers, considering that case-insensitive searches are just as useful as case-sensitive ones regardless if value is simple or complex? I wasn't a participant in CF-3316776 and feel it was fixed the wrong way (IMO, the broken functionality should've been fixed instead of removed). Thanks!, -Aaron
Comment by Aaron N.
31239 | August 28, 2019 07:22:49 AM GMT