Bug 29844: Fix ->search occurrences
[koha-ffzg.git] / admin / koha2marclinks.pl
index d26f6e5..b60e4fd 100755 (executable)
@@ -22,14 +22,13 @@ use Modern::Perl;
 use CGI qw ( -utf8 );
 
 use Koha::Database;
-use C4::Auth;
-use C4::Biblio;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 use Koha::BiblioFrameworks;
 use Koha::Caches;
 use Koha::MarcSubfieldStructures;
 
-my $input       = new CGI;
+my $input       = CGI->new;
 
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
     {
@@ -37,7 +36,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
         query           => $input,
         type            => "intranet",
         flagsrequired   => { parameters => 'manage_marc_frameworks' },
-        debug           => 1,
     }
 );
 
@@ -93,7 +91,7 @@ my @loop_data;
 foreach my $col ( @cols ) {
     my $found;
     my $readonly = $col =~ /\.(biblio|biblioitem|item)number$/;
-    foreach my $row ( $kohafields->search({ kohafield => $col }) ) {
+    foreach my $row ( $kohafields->search({ kohafield => $col })->as_list ) {
         $found = 1;
         push @loop_data, {
             kohafield    => $col,