Title:
list iteration & member functions all need to expect both a "delimiters" and a "includeEmptyValues" argument.
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 04/27/2014
Components: Language
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: PublicBeta /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
SSIA, but details: http://cfmlblog.adamcameron.me/2014/04/bugs-in-iterator-functions-in-both.html
Summary:
list = ",2,,4,,,7,,,,";
lengthNoEmpties = listLen(list);
lengthWithEmpties = listLen(list,",",true);
writeDump([list,lengthNoEmpties,lengthWithEmpties]);
writeOutput("<br>listFilter() with empties: ");
filtered = listFilter(list, function(v){
if (isNumeric(v)){
return v mod 2; // ie: odd numbers
}
return true;
}, ",", true);
writeDump([filtered]);
And results (Railo first):
Array
1
string ,2,,4,,,7,,,,
2
number 3
3
number 11
listFilter() with empties:
Array
1
string ,,,,7,,,,
So Railo gets it dead right.
ColdFusion:
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Parameter validation error for the LISTFILTER function.
The function accepts 2 to 3 parameters.
That's not right. The list iteration functions need to - across the board - also expect both a "delimiters" and a "includeEmptyValues" argument.
--
Adam
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3750734
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: