tracker issue : CF-3815958

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

callback version of listSort does not honor delimeters like ":" ,"|". Honors only ","

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Suchika Singh)

Created: 09/01/2014

Components: Language

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: 290973 /

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Win XP All

Vote Count: 0

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 25, 2019 using build 2016.0.01.298513
Problem:
callback version of listSort does not honor delimeters like ":" ,"|". Honors only ","
Method:Run the following code:
<cfscript>
	mylist ="e:b:a:c:d";
	sortedlist = ListSort(  mylist,  myComparator);
	
	sortedlist_delimter = ListSort(  mylist,  myComparator, ":");
										   
function myComparator(a, b) 
	{
	 if(a > b)
	 	return 1;
	 else
	 	return -1;
	}
writeoutput("Unsorted List: " &mylist);
writeoutput("<br>");
writeoutput("Sorted list With two paramters:" & sortedlist);
writeoutput("<br>");
writeoutput("Sorted list With three paramters:  " &  sortedlist_delimter);											   
</cfscript>

Result:Unsorted List: e:b:a:c:d
Sorted list With two paramters:e:b:a:c:d
Sorted list With three paramters: e:b:a:c:d

Expected:
Unsorted List: e:b:a:c:d
Sorted list With two paramters:a:b:c:d:e
Sorted list With three paramters: a:b:c:d:e

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

Watson Bug ID:	3815958

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

Attachments:

Comments:

Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). The code in the description threw "Invalid sort type [....] Valid sort type values are: Text, TextNoCase, and Numeric." in CF11 Update 7 (build 11.0.07.296330), even w/o the delimiter parameter in the comparator. Thanks!, -Aaron
Comment by Aaron N.
31196 | August 25, 2019 04:52:36 AM GMT