@@ -, +, @@ --- C4/Biblio.pm | 12 +++++------- C4/ILSDI/Services.pm | 6 +++--- C4/ImportBatch.pm | 4 ++-- C4/Serials.pm | 2 +- catalogue/imageviewer.pl | 2 +- catalogue/issuehistory.pl | 4 ++-- opac/opac-imageviewer.pl | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -998,7 +998,7 @@ sub GetISBDView { =head2 GetBiblio - ( $count, @results ) = &GetBiblio($biblionumber); + my $biblio = &GetBiblio($biblionumber); =cut @@ -1009,12 +1009,10 @@ sub GetBiblio { my $count = 0; my @results; $sth->execute($biblionumber); - while ( my $data = $sth->fetchrow_hashref ) { - $results[$count] = $data; - $count++; - } # while - $sth->finish; - return ( $count, @results ); + if ( my $data = $sth->fetchrow_hashref ) { + return $data; + } + return; } # sub GetBiblio =head2 GetBiblioItemInfosOf --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -411,7 +411,7 @@ sub GetPatronInfo { # Add additional fields $reserve->{'item'} = $item; $reserve->{'branchname'} = $branchname; - $reserve->{'title'} = ( GetBiblio( $reserve->{'biblionumber'} ) )[1]->{'title'}; + $reserve->{'title'} = GetBiblio( $reserve->{'biblionumber'} )->{'title'}; } $borrower->{'holds'}->{'hold'} = \@reserves; } @@ -597,7 +597,7 @@ sub HoldTitle { # Get the biblio record, or return an error code my $biblionumber = $cgi->param('bib_id'); - my ( $count, $biblio ) = GetBiblio( $biblionumber ); + my $biblio = GetBiblio( $biblionumber ); return { code => 'RecordNotFound' } unless $$biblio{biblionumber}; my $title = $$biblio{title}; @@ -662,7 +662,7 @@ sub HoldItem { # Get the biblio or return an error code my $biblionumber = $cgi->param('bib_id'); - my ( $count, $biblio ) = GetBiblio($biblionumber); + my $biblio = GetBiblio($biblionumber); return { code => 'RecordNotFound' } unless $$biblio{biblionumber}; my $title = $$biblio{title}; --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -539,7 +539,7 @@ sub BatchCommitBibRecords { } elsif ($bib_result eq 'replace') { $num_updated++; my $biblionumber = $bib_match; - my ($count, $oldbiblio) = GetBiblio($biblionumber); + my $oldbiblio = GetBiblio($biblionumber); my $oldxml = GetXmlBiblio($biblionumber); # remove item fields so that they don't get @@ -679,7 +679,7 @@ sub BatchRevertBibRecords { $num_reverted++; my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'}); my $biblionumber = $rowref->{'matched_biblionumber'}; - my ($count, $oldbiblio) = GetBiblio($biblionumber); + my $oldbiblio = GetBiblio($biblionumber); $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'}); ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'}); SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted'); --- a/C4/Serials.pm +++ a/C4/Serials.pm @@ -1302,7 +1302,7 @@ sub NewSubscription { logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); #set serial flag on biblio if not already set. - my ( $null, ($bib) ) = GetBiblio($biblionumber); + my $bib = GetBiblio($biblionumber); if ( !$bib->{'serial'} ) { my $record = GetMarcBiblio($biblionumber); my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $bib->{'frameworkcode'} ); --- a/catalogue/imageviewer.pl +++ a/catalogue/imageviewer.pl @@ -41,7 +41,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $biblionumber = $query->param('biblionumber') || $query->param('bib'); my $imagenumber = $query->param('imagenumber'); -my ( $count, $biblio ) = GetBiblio($biblionumber); +my $biblio = GetBiblio($biblionumber); my $itemcount = GetItemsCount($biblionumber); my @items = GetItemsInfo($biblionumber); --- a/catalogue/issuehistory.pl +++ a/catalogue/issuehistory.pl @@ -61,10 +61,10 @@ if ($itemnumber){ ); } else { $issues = GetBiblioIssues($biblionumber); - my (undef,@biblio)=GetBiblio($biblionumber); + my $biblio = GetBiblio($biblionumber); my $total = scalar @$issues; $template->param( - %{$biblio[0]}, + %{$biblio}, ); } foreach (@{$issues}){ --- a/opac/opac-imageviewer.pl +++ a/opac/opac-imageviewer.pl @@ -39,7 +39,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $biblionumber = $query->param('biblionumber') || $query->param('bib'); my $imagenumber = $query->param('imagenumber'); -my ( $count, $biblio ) = GetBiblio($biblionumber); +my $biblio = GetBiblio($biblionumber); if ( C4::Context->preference("OPACLocalCoverImages") ) { my @images = ListImagesForBiblio($biblionumber); --