From ee5ecb043e985ff59fe045b5f596d8f90d907ef3 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 10 Mar 2020 15:11:07 +0000 Subject: [PATCH] Bug 21708: Sort MARC fields in TransformHtmlToMarc Instead of pushing 999 in the front :) Test plan: Do not yet apply this patch. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field (MARC21 999) follows leader. Apply this patch. Restart Plack. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field is in right position. Run t/db_dependent/Biblio/TransformHtmlToMarc.t. Should pass now. Signed-off-by: Bernardo Gonzalez Kriegel Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 6cb9b3634dcc06bdd69b82960a257f38fd75e0d0) Signed-off-by: Lucas Gass --- C4/Biblio.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 07de581d88..a999be0260 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2378,6 +2378,7 @@ sub TransformHtmlToMarc { } } + @fields = sort { $a->tag() cmp $b->tag() } @fields; $record->append_fields(@fields); return $record; } -- 2.39.2