From 5d5d466128a25ea04840cb9af766a5267860568d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 25 Jan 2022 18:46:44 +0000 Subject: [PATCH] Bug 29946: Sort Marc profiles alphabetically To test: 1- Go to Tools > Stage MARC records for import 2- You'll need a MARC file, choose one and hit 'Upload file' 3- Create many Profiles with different names. I used ( ATop, ZTop, JTop, STop, etc. ) 4- Notice that the profiles sort in the order in which you create them 5- Apply patch 6- Try steps 1-2 again 7- Now the dropdown should be sorted alphabetically 8- Make a few more profiles and make sure they are being inserted in the right order alphabetically Signed-off-by: Barbara Johnson --- .../intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 7877265d90..40483ec0d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -482,6 +482,9 @@ .then(resolve, reject); }) .then(function(profiles) { + profiles.sort( function(a, b) { + return a.name < b.name ? -1 : 1; + }); profiles.forEach(function(profile) { const opt = $("