diff --git a/C4/Biblio.pm b/C4/Biblio.pm index a112c84757..52119ea990 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1104,20 +1104,17 @@ sub GetXmlBiblio { =head2 GetCOinSBiblio - my $coins = GetCOinSBiblio($biblionumber); + my $coins = GetCOinSBiblio($record); -Returns the COinS(a span) which can be included in a biblio record +Returns the COinS (a span) which can be included in a biblio record =cut sub GetCOinSBiblio { - my ($biblionumber) = @_; - my $record = GetMarcBiblio($biblionumber); + my $record = shift; # get the coin format if ( ! $record ) { - # can't get a valid MARC::Record object, bail out at this point - warn "We called GetMarcBiblio with a biblionumber that doesn't exist biblionumber=$biblionumber"; return; } my $pos7 = substr $record->leader(), 7, 1; diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 8a171821b7..18535a5724 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -217,7 +217,7 @@ sub shelfpage ($$$$$) { #$this_item->{'description'} = $itemtypes->{ $this_item->{itemtype} }->{'description'}; $this_item->{'dateadded'} = format_date( $this_item->{'dateadded'} ); $this_item->{'imageurl'} = getitemtypeinfo( $this_item->{'itemtype'} )->{'imageurl'}; - $this_item->{'coins'} = GetCOinSBiblio( $this_item->{'biblionumber'} ); + $this_item->{'coins'} = GetCOinSBiblio( $record ); $this_item->{'subtitle'} = GetRecordValue('subtitle', $record, GetFrameworkCode($this_item->{'biblionumber'})); $this_item->{'normalized_upc'} = GetNormalizedUPC( $record,$marcflavour); $this_item->{'normalized_ean'} = GetNormalizedEAN( $record,$marcflavour); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index d3c7e2a15f..e2fb0691cd 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -599,7 +599,7 @@ $template->param( # COinS format FIXME: for books Only $template->param( - ocoins => GetCOinSBiblio($biblionumber), + ocoins => GetCOinSBiblio($record), ); my $libravatar_enabled = 0; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 716b16413b..42eb0ecc78 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -506,7 +506,8 @@ for (my $i=0;$i<@servers;$i++) { } if (C4::Context->preference('COinSinOPACResults')) { foreach (@newresults) { - $_->{coins} = GetCOinSBiblio($_->{'biblionumber'}); + my $record = GetMarcBiblio($_->{'biblionumber'}); + $_->{coins} = GetCOinSBiblio($record); } }