Bug 25672: Fix double output_html_with_http_headers
We weren't exiting after calling output_html_with_http_headers and so we were ending up with a double template render (and also a subsequent confusion in the cookie consent code). Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
9d236a20f2
commit
0f3e68f75f
1 changed files with 9 additions and 4 deletions
|
@ -35,24 +35,27 @@ my $plugins_enabled = C4::Context->config("enable_plugins");
|
|||
my $plugins_restricted = C4::Context->config("plugins_restricted");
|
||||
|
||||
my $input = CGI->new;
|
||||
my $uploadlocation = $input->param('uploadlocation');
|
||||
|
||||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
||||
{
|
||||
template_name => $plugins_enabled ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
|
||||
template_name => ( !$plugins_enabled || $plugins_restricted && !$uploadlocation )
|
||||
? 'plugins/plugins-disabled.tt'
|
||||
: 'plugins/plugins-upload.tt',
|
||||
query => $input,
|
||||
type => "intranet",
|
||||
flagsrequired => { plugins => 'manage' },
|
||||
}
|
||||
);
|
||||
|
||||
my $uploadlocation = $input->param('uploadlocation');
|
||||
|
||||
# Early exists if uploads are not enabled direct upload attempted when uploads are restricted
|
||||
# Early exist if uploads are not enabled direct upload attempted when uploads are restricted
|
||||
if (!$plugins_enabled) {
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
exit;
|
||||
} elsif ( $plugins_restricted && !$uploadlocation ) {
|
||||
$template->param( plugins_restricted => $plugins_restricted );
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
exit;
|
||||
}
|
||||
|
||||
my $uploadfilename = $input->param('uploadfile');
|
||||
|
@ -132,3 +135,5 @@ if ( ( $uploadfile || $uploadlocation ) && !%errors && !$template->param('ERRORS
|
|||
} else {
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
}
|
||||
|
||||
exit;
|
||||
|
|
Loading…
Reference in a new issue