use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
use JSON qw/ to_json /;
use C4::Context;
my $import_batch_id = $input->param('import_batch_id');
my $offset = $input->param('iDisplayStart');
my $results_per_page = $input->param('iDisplayLength');
-my $sorting_column = $sort_columns[ $input->param('iSortCol_0') ];
+my $sorting_column = $sort_columns[ $input->param('iSortCol_0') // 0 ];
my $sorting_direction = $input->param('sSortDir_0');
-$results_per_page = undef if ( $results_per_page == -1 );
+$results_per_page = undef if $results_per_page && $results_per_page == -1;
binmode STDOUT, ":encoding(UTF-8)";
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
|| q{},
score => $#$match > -1 ? $match->[0]->{'score'} : 0,
match_id => $match_id,
+ diff_url => $match_id ? "/cgi-bin/koha/tools/showdiffmarc.pl?batchid=$import_batch_id&importid=$record->{import_record_id}&id=$match_id" : undef
};
}