Bug 22022: Correct ordering for authorised values
[koha.git] / tools / batchMod.pl
index 1380d61..afb2d29 100755 (executable)
@@ -388,7 +388,7 @@ foreach my $tag (sort keys %{$tagslib}) {
       else {
           push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
 
-          my @avs = Koha::AuthorisedValues->search({ category => $tagslib->{$tag}->{$subfield}->{authorised_value}, branchcode => $branch_limit });
+          my @avs = Koha::AuthorisedValues->search({ category => $tagslib->{$tag}->{$subfield}->{authorised_value}, branchcode => $branch_limit },{order_by=>'lib'});
           for my $av ( @avs ) {
               push @authorised_values, $av->authorised_value;
               $authorised_lib{$av->authorised_value} = $av->lib;