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 <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-01-31 18:27:05 -06:00 committed by Joshua Ferraro
parent 60a98d258a
commit 6eba80e5f5
1 changed files with 3 additions and 2 deletions

View File

@ -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;