Bug 15005: Replace $ENV{SCRIPT_NAME} with the hardcoded script paths
Since I don't manage to make SCRIPT_NAME works directly with RequestHeader and/or ReverseProxyPath, the easier way it to fix all the different occurrences. Test plan: On the import patrons page, confirm that the "Import" button does not redirect to a 'Not found' page. You should stay on the import patrons page. Note that if this change works, all others should work too. Have a look at the diff of this patch and confirm there is no typo. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Tested in patron import and item batch modification Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
6c30d31af7
commit
02492bd6ea
|
|
@ -78,7 +78,7 @@ if ($completedJobID) {
|
|||
|
||||
if ($runinbackground) {
|
||||
my $job_size = scalar(@input_lines);
|
||||
$job = C4::BackgroundJob->new($sessionID, $filename, $ENV{'SCRIPT_NAME'}, $job_size);
|
||||
$job = C4::BackgroundJob->new($sessionID, $filename, '/cgi-bin/koha/offline_circ/process_koc.pl', $job_size);
|
||||
my $jobID = $job->id();
|
||||
|
||||
# fork off
|
||||
|
|
@ -104,7 +104,7 @@ if ($completedJobID) {
|
|||
} else {
|
||||
# fork failed, so exit immediately
|
||||
# fork failed, so exit immediately
|
||||
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
|
||||
warn "fork failed while attempting to run offline_circ/process_koc.pl as a background job";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ sub add_saved_job_results_to_template {
|
|||
sub put_in_background {
|
||||
my $job_size = shift;
|
||||
|
||||
my $job = C4::BackgroundJob->new($sessionID, "test", $ENV{'SCRIPT_NAME'}, $job_size);
|
||||
my $job = C4::BackgroundJob->new($sessionID, "test", '/cgi-bin/koha/tools/batchMod.pl', $job_size);
|
||||
my $jobID = $job->id();
|
||||
|
||||
# fork off
|
||||
|
|
@ -696,7 +696,7 @@ sub put_in_background {
|
|||
close STDERR;
|
||||
} else {
|
||||
# fork failed, so exit immediately
|
||||
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
|
||||
warn "fork failed while attempting to run tools/batchMod.pl as a background job";
|
||||
exit 0;
|
||||
}
|
||||
return $job;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ if ( $op eq 'form' ) {
|
|||
my ( $job );
|
||||
if ( $runinbackground ) {
|
||||
my $job_size = scalar( @record_ids );
|
||||
$job = C4::BackgroundJob->new( $sessionID, "FIXME", $ENV{SCRIPT_NAME}, $job_size );
|
||||
$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;
|
||||
|
|
@ -169,7 +169,7 @@ if ( $op eq 'form' ) {
|
|||
close STDOUT;
|
||||
close STDERR;
|
||||
} else {
|
||||
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
|
||||
warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job";
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ if ($matchpoint) {
|
|||
}
|
||||
my $overwrite_cardnumber = $input->param('overwrite_cardnumber');
|
||||
|
||||
$template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'} );
|
||||
$template->param( SCRIPT_NAME => '/cgi-bin/koha/tools/import_borrowers.pl' );
|
||||
|
||||
if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
|
||||
push @feedback, {feedback=>1, name=>'filename', value=>$uploadborrowers, filename=>$uploadborrowers};
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ sub put_in_background {
|
|||
my $import_batch_id = shift;
|
||||
|
||||
my $batch = GetImportBatch($import_batch_id);
|
||||
my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, $ENV{'SCRIPT_NAME'}, $batch->{'num_records'});
|
||||
my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, '/cgi-bin/koha/tools/manage-marc-import.pl', $batch->{'num_records'});
|
||||
my $jobID = $job->id();
|
||||
|
||||
# fork off
|
||||
|
|
@ -318,7 +318,7 @@ sub put_in_background {
|
|||
close STDERR;
|
||||
} else {
|
||||
# fork failed, so exit immediately
|
||||
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
|
||||
warn "fork failed while attempting to run tools/manage-marc-import.pl as a background job";
|
||||
exit 0;
|
||||
}
|
||||
return $job;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ if( $importid ) {
|
|||
|
||||
|
||||
$template->param(
|
||||
SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
|
||||
SCRIPT_NAME => '/cgi-bin/koha/tools/showdiffmarc.pl',
|
||||
BIBLIONUMBER => $biblionumber,
|
||||
IMPORTID => $importid,
|
||||
BIBLIOTITLE => $biblioTitle,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
);
|
||||
|
||||
$template->param(
|
||||
SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
|
||||
SCRIPT_NAME => '/cgi-bin/koha/tools/stage-marc-import.pl',
|
||||
uploadmarc => $fileID,
|
||||
record_type => $record_type,
|
||||
);
|
||||
|
|
@ -102,7 +102,7 @@ if ($completedJobID) {
|
|||
my $job_size = () = $marcrecord =~ /\035/g;
|
||||
# if we're matching, job size is doubled
|
||||
$job_size *= 2 if ($matcher_id ne "");
|
||||
$job = C4::BackgroundJob->new($sessionID, $filename, $ENV{'SCRIPT_NAME'}, $job_size);
|
||||
$job = C4::BackgroundJob->new($sessionID, $filename, '/cgi-bin/koha/tools/stage-marc-import.pl', $job_size);
|
||||
my $jobID = $job->id();
|
||||
|
||||
# fork off
|
||||
|
|
@ -121,7 +121,7 @@ if ($completedJobID) {
|
|||
# close STDERR; # there is no good reason to close STDERR
|
||||
} else {
|
||||
# fork failed, so exit immediately
|
||||
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job: $!";
|
||||
warn "fork failed while attempting to run tools/stage-marc-import.pl as a background job: $!";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue