From 6eba80e5f54e03df635b690e0700cc3bfbd60e15 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Jan 2008 18:27:05 -0600 Subject: [PATCH] temp bugfix -- restore file upload functionality CGI->new() should not be used in any C4 module - it has a side-effect that breaks the AJAX file upload script. Specifically, any file upload field is slurped when a new CGI object is created, and is not available to a second object created by CGI->new(). Consequently, C4::Debug should not be instantiating a CGI object in its BEGIN block. It can use other CGI::* modules to parse QUERY_STRING to get the value of the debug parameter (note that this means that the debug param can be reliably set only in a GET, not as part of a form submission). Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Debug.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Debug.pm b/C4/Debug.pm index ef4484c216..51e765a7f1 100644 --- a/C4/Debug.pm +++ b/C4/Debug.pm @@ -37,9 +37,10 @@ BEGIN { BEGIN { # this stuff needs a begin block too, since dependencies might alter their compilations # for example, adding DataDumper - my $query = CGI->new(); + #my $query = CGI->new(); $debug = $ENV{KOHA_DEBUG} || $ENV{DEBUG} || 0; - $cgi_debug = $ENV{KOHA_CGI_DEBUG} || $query->param('debug') || 0; + #$cgi_debug = $ENV{KOHA_CGI_DEBUG} || $query->param('debug') || 0; + $cgi_debug = $ENV{KOHA_CGI_DEBUG} || 0; unless (0 <= $debug and $debug <= 9) { warn "Invalid \$debug value attempted: $debug"; $debug=1; -- 2.20.1