Bug 32836: Fix cataloguing/value_builder/unimarc_field_123a.pl
[koha-ffzg.git] / catalogue / export.pl
index f12cd57..ff02cea 100755 (executable)
@@ -2,11 +2,11 @@
 use Modern::Perl;
 
 use C4::Record;
-use C4::Auth;
+use C4::Auth qw( get_template_and_user );
 use C4::Output;
-use C4::Biblio;
+use C4::Biblio qw( GetMarcControlnumber );
 use CGI qw ( -utf8 );
-use C4::Ris;
+use C4::Ris qw( marc2ris );
 
 
 
@@ -16,7 +16,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
     query           => $query,
     type            => "intranet",
     flagsrequired   => { catalogue => 1 },
-    debug           => 1,
     });
 
 my $op=$query->param("op");
@@ -28,9 +27,8 @@ if ($op eq "export") {
             my $file_id = $biblionumber;
             my $file_pre = "bib-";
 
-            my $marc = GetMarcBiblio({
-                biblionumber => $biblionumber,
-                embed_items  => 1 });
+            my $biblio = Koha::Biblios->find($biblionumber);
+            my $marc   = $biblio->metadata->record({ embed_items => 1 });
 
             if( C4::Context->preference('DefaultSaveRecordFileID') eq 'controlnumber' ){
                 my $marcflavour = C4::Context->preference('marcflavour'); #FIXME This option is required but does not change control num behaviour