@@ -, +, @@ - Do not apply patch - Create a report with the following SQL: SELECT * FROM message_queue; - Create an ILL request with plenty of metadata - Go to "Manage request" - Send a notice to a patron - Run the report created earlier - Observe that the metadata is in random order - Apply the patch - Create an ILL request with plenty of metadata - Go to "Manage request" - Send a notice to a patron - Run the report created earlier - Observe that the metadata is now sorted alphabetically by key --- Koha/Illrequest.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/Koha/Illrequest.pm +++ a/Koha/Illrequest.pm @@ -1558,7 +1558,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); --