If countitems not set to 1 it was not being declared
but is referred to outside this scope, generating
runtime warnings and test failure
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
my $record = MARC::Record::new_from_usmarc( $results->[$i] );
my $rechash = TransformMarcToKoha( $dbh, $record );
my $pos;
- my $countitems = 1 if ( $rechash->{itemnumber} );
+ my $countitems = $rechash->{itembumber} ? 1 : 0;
while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
$countitems += 1;
$pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
output_html_with_http_headers $query, $cookie, $template->output;
}
-1;
\ No newline at end of file
+1;