If countitems not set to 1 it was not being declared
but is referred to outside this scope, generating
runtime warnings and test failure
---
 cataloguing/value_builder/marc21_linking_section.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cataloguing/value_builder/marc21_linking_section.pl 
b/cataloguing/value_builder/marc21_linking_section.pl
index 275d3a5..f317f8b 100644
--- a/cataloguing/value_builder/marc21_linking_section.pl
+++ b/cataloguing/value_builder/marc21_linking_section.pl
@@ -226,7 +226,7 @@ sub plugin {
                       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;
@@ -406,4 +406,4 @@ sub plugin {
       output_html_with_http_headers $query, $cookie, $template->output;
 }
 
-1;
\ No newline at end of file
+1;
-- 
1.7.12.464.g83379df

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to