diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 7decbc1f2d..7ea301fde3 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1556,7 +1556,8 @@ sub get_notice { ); my $metahash = $self->metadata; my @metaarray = (); - while (my($key, $value) = each %{$metahash}) { + foreach my $key (sort { lc $a cmp lc $b } keys %{$metahash}) { + my $value = $metahash->{$key}; push @metaarray, "- $key: $value" if $value; } my $metastring = join("\n", @metaarray);