From 65f9b37b145aab8ae18a8758097965c331cfdf1d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Apr 2015 12:24:28 +0200 Subject: [PATCH] Bug 9472: Order subfields alphabeticaly when cataloging On cataloging a record, the subfields without data were put at the end of the other subfields. This patch orders the subfields alphabeticaly even if they don't containt any data. Test plan: 1/ Edit a record with some subfields without any data => The subfield should not be visible (maybe they are if they are mandatory). 2/ Click on a tag to expand the subfield list. 3/ The subfields should be ordered alphabaticaly --- cataloguing/addbiblio.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 5d46d09..6f63eea 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -640,6 +640,7 @@ sub build_tabs { # note that the random() field is mandatory. Otherwise, on repeated fields, you'll # have twice the same "name" value, and cgi->param() will return only one, making # all subfields to be merged in a single field. + @subfields_data = sort { $a->{subfield} cmp $b->{subfield} } @subfields_data; my %tag_data = ( tag => $tag, index => $index_tag, @@ -686,6 +687,7 @@ sub build_tabs { ); } if ( $#subfields_data >= 0 ) { + @subfields_data = sort { $a->{subfield} cmp $b->{subfield} } @subfields_data; my %tag_data = ( tag => $tag, index => $index_tag, -- 2.1.0