Bug 10038: fix doubled 'default' entry when creating a new authority type
[koha.git] / admin / auth_tag_structure.pl
index 906f8d3..e84b459 100755 (executable)
@@ -57,7 +57,7 @@ my ($template, $loggedinuser, $cookie)
 # get authtype list
 my $authtypes     = getauthtypes;
 my @authtypesloop = ();
-foreach my $thisauthtype ( keys %{$authtypes} ) {
+foreach my $thisauthtype ( sort keys %{$authtypes} ) {
     push @authtypesloop,
       { value        => $thisauthtype,
         selected     => $thisauthtype eq $authtypecode,
@@ -209,6 +209,7 @@ if ($op eq 'add_form') {
                        push @existingauthtypeloop,\%line;
                }
        }
+    @existingauthtypeloop = sort { lc($a->{authtypetext}) cmp lc($b->{authtypetext}) }@existingauthtypeloop;
        $template->param(existingauthtypeloop => \@existingauthtypeloop,
                                        authtypecode => $authtypecode,
                                        );