In that case they seem to be working for me.
I am using utf8 charset and the edited function in the ditto.class.inc.php looks like this:
// ---------------------------------------------------
// Function: customSort
// Sort resource array if advanced sorting is needed
// ---------------------------------------------------
function customSort($data, $fields, $order) {
// Covert $fields string to array
// user contributed
return $data;
foreach (explode(',', $fields) as $s)
$sortfields[] = trim($s);
$code = "";
for ($c = 0; $c < count($sortfields); $c++)
$code .= "\$retval = strnatcmp(\$a['$sortfields[$c]'], \$b['$sortfields[$c]']); if(\$retval) return \$retval; ";
$code .= "return \$retval;";
$params = ($order == 'ASC') ? '$a,$b' : '$b,$a';
uasort($data, create_function($params, $code));
return $data;
}
Notice the ’return $data’ at the top, this basically returns the same data as was entered thus turning off the function.
One thing that eventually helped me narrow down the problem was to turn on the ditto debug console and compare output or to try a SQL query directly in the data base and see if it sorts correctly. This way you can see if the problem is a charset issue, ditto issue or whatever.