Bug 14607: Baker & Taylor cover images should be accessible by UPC as well as ISBN
[koha.git] / opac / oai.pl
index 875801b..7eb0f6b 100755 (executable)
@@ -334,7 +334,7 @@ sub new {
     # We fetch it using this method, rather than the database directly,
     # so it'll include the item data
     my $marcxml;
-    $marcxml = $repository->get_biblio_marcxml->($biblionumber, $args{metadataPrefix})
+    $marcxml = $repository->get_biblio_marcxml($biblionumber, $args{metadataPrefix})
         unless $deleted;
     my $oai_sets = GetOAISetsBiblio($biblionumber);
     my @setSpecs;
@@ -577,6 +577,7 @@ sub new {
     $sth->execute( @bind_params );
 
     my $count = 0;
+    my $format = $args{metadataPrefix} || $token->{metadata_prefix};
     while ( my ($biblionumber, $timestamp) = $sth->fetchrow ) {
         $count++;
         if ( $count > $max ) {
@@ -591,7 +592,7 @@ sub new {
             );
             last;
         }
-        my $marcxml = $repository->get_biblio_marcxml($biblionumber, $args{metadataPrefix});
+        my $marcxml = $repository->get_biblio_marcxml($biblionumber, $format);
         my $oai_sets = GetOAISetsBiblio($biblionumber);
         my @setSpecs;
         foreach (@$oai_sets) {