Bug 21172: Remove warning from addbiblio.pl
Argument "01e" isn't numeric in numeric ne (!=) at /home/vagrant/kohaclone/cataloguing/addbiblio.pl line 507. A tagfield can be 01e and so raise a warning is compared with == or != This patch also fixes few inconsistencies: - tagfield for items.itemnumber must be retrieved with GetMarcFromKohaField (to support other marcflavours) - do not use $_ - loop only once on $usedTagsLib Test plan: For devs only, read the code and confirm the changes make sense. Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
4177d2e329
commit
f3afec0587
|
|
@ -489,16 +489,19 @@ sub build_tabs {
|
|||
my @BIG_LOOP;
|
||||
my %seen;
|
||||
my @tab_data; # all tags to display
|
||||
|
||||
|
||||
my $max_num_tab=-1;
|
||||
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", scalar $input->param('frameworkcode') );
|
||||
foreach my $used ( @$usedTagsLib ){
|
||||
|
||||
push @tab_data,$used->{tagfield} if not $seen{$used->{tagfield}};
|
||||
$seen{$used->{tagfield}}++;
|
||||
}
|
||||
|
||||
my $max_num_tab=-1;
|
||||
foreach(@$usedTagsLib){
|
||||
if($_->{tab} > -1 && $_->{tab} >= $max_num_tab && $_->{tagfield} != '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){
|
||||
|
|
|
|||
Loading…
Reference in New Issue