@@ -, +, @@ batch_record_modification.pl --- debian/templates/apache-shared-intranet-plack.conf | 1 - tools/batch_record_modification.pl | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) --- a/debian/templates/apache-shared-intranet-plack.conf +++ a/debian/templates/apache-shared-intranet-plack.conf @@ -13,7 +13,6 @@ # don't break under plack/starman ProxyPass "/cgi-bin/koha/offline_circ/process_koc.pl" "!" ProxyPass "/cgi-bin/koha/tools/background-job-progress.pl" "!" - ProxyPass "/cgi-bin/koha/tools/batch_record_modification.pl" "!" ProxyPass "/cgi-bin/koha/tools/batchMod.pl" "!" ProxyPass "/cgi-bin/koha/tools/manage-marc-import.pl" "!" ProxyPass "/cgi-bin/koha/tools/stage-marc-import.pl" "!" --- a/tools/batch_record_modification.pl +++ a/tools/batch_record_modification.pl @@ -159,15 +159,11 @@ if ( $op eq 'form' ) { $job = C4::BackgroundJob->new( $sessionID, "FIXME", '/cgi-bin/koha/tools/batch_record_modification.pl', $job_size ); my $job_id = $job->id; if (my $pid = fork) { - $dbh->{InactiveDestroy} = 1; - my $reply = CGI->new(""); - print $reply->header(-type => 'text/html'); + print $reply->header(-type => 'application/json'); print '{"jobID":"' . $job_id . '"}'; exit 0; - } elsif (defined $pid) { - close STDOUT; - } else { + } elsif (not defined $pid) { warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job"; exit 0; } @@ -244,8 +240,13 @@ if ( $op eq 'form' ) { } if ($runinbackground) { - $job->finish if defined $job; - } else { + if ( $job ) { + $job->finish; + print $input->redirect('/cgi-bin/koha/tools/background.pl?just_a_param=1'); + } + } + else { + # FIXME Do not think this is reach $template->param( view => 'report', report => $report, --