tracker issue : CF-3335956

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

[ANeff] Bug for: ArrayContainsNoCase and ArrayDeleteNoCase are missing

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 09/24/2012

Components: Language

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 26, 2019 using build 2016.0.01.298513
ArrayContains and ArrayDelete are case-sensitive. However, the case-insensitive version of these (ArrayContainsNoCase and ArrayDeleteNoCase) are missing.

Repro:

<cfscript>
  writeOutput(ArrayContains(["STRING","STRING"], "string"));
</cfscript>
Actual Result: NO
Expected Result: NO

<cfscript>
  writeOutput(ArrayContainsNoCase(["STRING","STRING"], "string"));
</cfscript>
Actual Result: Variable ARRAYCONTAINSNOCASE is undefined. 
Expected Result: YES

<cfscript>
  writeOutput(ArrayDelete(["STRING","STRING"], "string"));
</cfscript>
Actual Result: NO
Expected Result: NO

<cfscript>
  writeOutput(ArrayDeleteNoCase(["STRING","STRING"], "string"));
</cfscript>
Actual Result: Variable ARRAYDELETENOCASE is undefined.
Expected Result: YES

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3335956

External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:

Attachments:

Comments:

Following synatx does not work.. data = [aaaa, ["sam", "john"]]; elementToFind = ["SAM", "JOHN"]; inn =ArrayFindNoCase(data, elementToFind); writeoutput("Index found at #inn#</br>"); It seems the function will not serve the purpose well and rather will bring confusion.
Comment by Awdhesh K.
17979 | December 17, 2013 11:47:31 PM GMT
Hi Awdhesh, I'm searching for a 'string', not an 'array'. Can you please try this? <cfscript> data = ["aaaa", ["sam", "john"]]; elementToFind = "AAAA";//string inn = ArrayFindNoCase(data, elementToFind); writeoutput("Index found at #inn#</br>"); </cfscript> Result: Index found at 1 (good) <cfscript> data = ["aaaa", ["sam", "john"]]; elementToFind = "AAAA";//string inn = ArrayContainsNoCase(data, elementToFind); writeoutput("Array contains string? #inn#</br>"); </cfscript> Error: Variable ARRAYCONTAINSNOCASE is undefined. (bad) <cfscript> data = ["aaaa", ["sam", "john"]]; elementToFind = "AAAA";//string inn = ArrayDeleteNoCase(data, elementToFind); writeoutput("Array element deleted? #inn#</br>"); </cfscript> Error: Variable ARRAYDELETENOCASE is undefined. (bad) Thanks, -Aaron
Comment by External U.
17980 | December 18, 2013 02:35:41 AM GMT
Hi Aaron, I agree with your while trying it with string. But I think in broader context, where this functionality can be tried with other data type rather than String. In earlier example I tried finding an array element (the 2nd element) where it not possible to check the existence case insensitively. Sorry I was not explanatory in my earlier comment, but what I wanted to convey was that we can add the asked functionality for String type sub-element of an array but same will not work when sub-element of array is an array. data = [aaaa, ["sam", "john"]]; elementToFind = ["SAM", "JOHN"]; // Element to find is an array with its element in upper case. inn =ArrayFindNoCase(data, elementToFind); // This will always fail even if we add the asked functionality. writeoutput("Index found at #inn#</br>");
Comment by Awdhesh K.
17981 | January 09, 2014 03:36:28 AM GMT
Hi Awdhesh, Regarding: "we can add the asked functionality for String type sub-element of an array but same will not work when sub-element of array is an array." Perfect. That would be consistent w/ ArrayFindNoCase(). Interestingly, ArrayContainsNoCase() and ArrayDeleteNoCase() are documented even tho they do not exist in the language. ArrayContainsNoCase() documentation: https://wikidocs.adobe.com/wiki/display/coldfusionen/ArrayContainsNoCase ArrayDeleteNoCase() documentation: https://wikidocs.adobe.com/wiki/display/coldfusionen/ArrayDeleteNoCase BTW, the ArrayDeleteNoCase() documentation shows the ArrayDelete() syntax and example. It should show the ArrayDeleteNoCase() syntax and example. Also, once ArrayContainsNoCase() and ArrayDeleteNoCase() are added to the language in Splendor, then the documentation for those should say: "ColdFusion 11: Added this function." Thanks!, -Aaron
Comment by External U.
17982 | March 01, 2014 05:11:44 AM GMT
Hi Adobe, What was fixed here? I see the ArrayContainsNoCase() doc was deleted, but the ArrayDeleteNoCase() doc remains and still has an arrayDelete() syntax and example. Can the ArrayDeleteNoCase() doc please be updated w/ a correct syntax and example? And why was the ArrayContainsNoCase() doc deleted? Also, what is the fix for the following?: "we can add the asked functionality for String type sub-element of an array but same will not work when sub-element of array is an array." Thanks!, -Aaron
Comment by External U.
17983 | January 06, 2015 05:54:55 PM GMT
I'm bemused too. I just tried arrayContainsNoCase() on the latest version of CF11, and got an error. Please make sure to explain things that are "fixed" rather than just changing a status flag.
Comment by External U.
17984 | September 14, 2015 03:49:23 PM GMT
+1 to what Adam said; I don't think anything was fixed in CF11.. Adobe, could you also please populate the "Fixed in Build" and check on the 2 docs? Thanks!, -Aaron
Comment by External U.
17985 | September 14, 2015 04:01:59 PM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513), including updated documentation. Adobe, why does the ArrayDeleteNoCase doc, under "Returns", have the word "deleting" highlighted? Just seems sorta odd :) Thanks!, -Aaron
Comment by Aaron N.
31221 | August 26, 2019 09:11:47 AM GMT