tracker issue : CF-4198356

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

Add callback to replacenocase function

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): / ()

Created: 02/23/2017

Components: Language, Functions

Versions: 2016

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF2016 /

Priority/Frequency: Normal /

Locale/System: / Win All

Vote Count: 3

ReplaceNoCase does not take a callback function, we should add callback for replacenocase operation.

Attachments:

Comments:

+1 - The Replace() callback only runs when Replace() finds a match. But, of course, Replace() would not find a match for "a" in a string containing only uppercase letters (for example). So.. the callback would never run. Thus, ReplaceNoCase() needs a callback. And, now we've set a precedent for ALL case-sensitive functions to accept a callback if their case-insensitive partner does.
Vote by Aaron N.
1163 | February 23, 2017 08:46:06 PM GMT
Please see my vote comment. Here is a repro case showing Replace() is case-sensitive and, thus, its callback will never be called when trying to match a letter of a different case: <cfscript> r = replace("ABC", "a", function() {writeDump(ARGUMENTS); abort;}, "all"); writeDump(r); </cfscript> The Replace() behavior is correct. However, it illustrates that ReplaceNoCase() also needs a callback. Note: If Application.cfc has both onError() and onAbort(), then the above abort will trigger onError() instead of onAbort(). Bug. Logged as CF-4198354.
Comment by Aaron N.
1160 | February 23, 2017 08:53:22 PM GMT
Why was this withdrawn? I can see there's a coupla "hidden" comments that might explain it, but whenever a ticket is closed you need to make a PUBLIC comment explaining what the story is. 04/10/2017 05:46:40 - The issue is not reproducible in latest cf_main code. ?The implementation for UDF support for replaceNoCase() function was added as a part of revision 298691 and bug no. 4120177 04/10/2017 05:51:32 - This is not reproducible in latest cf_main code.
Comment by Adam C.
1161 | July 07, 2017 11:05:29 AM GMT
Hi Adobe, +1 to everything Adam said. Duplicate ticket ID needs to be publicly visible. This new tracker is lacking in that functionality (pls fix TKR-15 w/ a "Duplicate ID" field like bugbase.adobe.com had). Can you please answer Adam's question on CF-4120177? (timestamp 11/22/2016 22:19:58 GMT) Thanks!, -Aaron
Comment by Aaron N.
1162 | July 10, 2017 12:17:51 AM GMT