Sort filters by localized name

The `UC_name_compare` function isn't defined, but was being used
to sort the prefilter list. This change adds a anonymous function
to do the sort comparison (on the filters' NAME attribute).
This commit is contained in:
Sam Wilson
2020-06-07 10:52:59 +08:00
committed by Pierrick Le Gall
parent 7d0f08c5a9
commit 35f0450699
+5 -1
View File
@@ -459,7 +459,11 @@ function UC_name_compare($a, $b)
}
$prefilters = trigger_change('get_batch_manager_prefilters', $prefilters);
usort($prefilters, 'UC_name_compare');
// Sort prefilters by localized name.
usort($prefilters, function ($a, $b) {
return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
});
$template->assign(
array(