- fix: 7.4 Editing SQL Form seems to break site ...?

This commit is contained in:
JT Smith 2007-03-09 05:38:44 +00:00
parent 3c7bfb6595
commit 172985e2a0
6 changed files with 33 additions and 43 deletions

View file

@ -609,7 +609,7 @@ Returns the timezone for this user, in DateTime::TimeZone format. Checks to mak
sub getTimeZone {
my $self = shift;
return 'America/Chicago' if $self->session->dbNotAvailable;
return 'America/Chicago' unless defined $self->session->db(1);
return $self->session->user->{_timeZone} if $self->session->user->{_timeZone};
my @zones = @{DateTime::TimeZone::all_names()};
my $zone = $self->session->user->profileField('timeZone');

View file

@ -208,15 +208,17 @@ sub fatal {
$self->getLogger->debug("Stack trace for FATAL ".$message."\n".$self->getStackTrace());
$self->session->http->sendHeader if ($self->session->request);
if ($self->session->dbNotAvailable) {
if (! defined $self->session->db(1)) {
# We can't even _determine_ whether we can show the debug text. Punt.
$self->session->output->print("<h1>Fatal Internal Error</h1>");
} elsif ($self->canShowDebug()) {
}
elsif ($self->canShowDebug()) {
$self->session->output->print("<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n",1);
$self->session->output->print("<p>".$message."</p>\n",1);
$self->session->output->print($self->getStackTrace(), 1);
$self->session->output->print($self->showDebug(),1);
} else {
}
else {
# NOTE: You can't internationalize this because with some types of errors that would cause an infinite loop.
$self->session->output->print("<h1>Problem With Request</h1>
We have encountered a problem with your request. Please use your back button and try again.

View file

@ -247,7 +247,7 @@ Generates and sends HTTP headers for a response.
sub sendHeader {
my $self = shift;
return undef if ($self->{_http}{noHeader});
return $self->_sendMinimalHeader if $self->session->dbNotAvailable;
return $self->_sendMinimalHeader unless defined $self->session->db(1);
my ($request, $datetime, $config, $var) = $self->session->quick(qw(request datetime config var));
return undef unless $request;