Bug 26992: Fix serial issue and related items deletion on serial collection page
[srvgit] / virtualshelves / downloadshelf.pl
index 5a9f440..c6cb31f 100755 (executable)
@@ -33,14 +33,13 @@ use Koha::CsvProfiles;
 use Koha::Virtualshelves;
 
 use utf8;
-my $query = new CGI;
+my $query = CGI->new;
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
     {
         template_name   => "virtualshelves/downloadshelf.tt",
         query           => $query,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { catalogue => 1 },
     }
 );
@@ -71,7 +70,9 @@ if ($shelfid && $format) {
             else { #Other formats
                 while ( my $content = $contents->next ) {
                     my $biblionumber = $content->biblionumber;
-                    my $record = GetMarcBiblio($biblionumber, 1);
+                    my $record = GetMarcBiblio({
+                        biblionumber => $biblionumber,
+                        embed_items  => 1 });
                     if ($format eq 'iso2709') {
                         $output .= $record->as_usmarc();
                     }
@@ -101,7 +102,7 @@ if ($shelfid && $format) {
     }
 }
 else {
-    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
+    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ]);
     $template->param(shelfid => $shelfid); 
 }
 $template->param( messages => \@messages );