From 35f04506996e55c1743d603a064c87087acc549b Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Sun, 7 Jun 2020 10:52:59 +0800 Subject: [PATCH] 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). --- admin/batch_manager_global.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index fd694534c..038b8a3eb 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -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(