From 4ad8d78a9ce277a96e515c67e96ec180b96785ed Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 6 May 2019 22:16:12 +0200 Subject: [PATCH] Bug 21280: (follow-up) Adapt bug 21172 to Koha::MarcEditor Test plan: As bug 21772 - read the code and confirm it makes sense Signed-off-by: Josef Moravec --- Koha/MarcEditor.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Koha/MarcEditor.pm b/Koha/MarcEditor.pm index a71fd3a..594d0c5 100644 --- a/Koha/MarcEditor.pm +++ b/Koha/MarcEditor.pm @@ -89,18 +89,21 @@ sub build_tabs { my %seen; my @tab_data; # all tags to display my $max_num_tab=-1; + my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" ); if (defined $self->{used_tags}) { foreach my $used ( @{$self->{used_tags}} ) { push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}}; $seen{$used->{tagfield}}++; - } - foreach (@{$self->{used_tags}}) { - if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} ne '995'){ # FIXME : MARC21 ? - $max_num_tab = $_->{tab}; + if ( $used->{tab} > -1 + && $used->{tab} >= $max_num_tab + && $used->{tagfield} ne $itemtag ) + { + $max_num_tab = $used->{tab}; } } + if ($max_num_tab >= 9) { $max_num_tab = 9; } -- 2.1.4