diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index dbbcfde7f..afe43d763 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -16,6 +16,7 @@ - fixed: Able to cut or trash system assets - fixed: Can't purge uncommitted assets if not using its version tag - fixed: DataForm will create fields with duplicate names but doesn't use them separately + - fixed: Bad message if database link for SQL Report doesn't exist 7.5.7 - fixed: HttpProxy mixes original site's content encoding with WebGUI's diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm index e7979d16a..466f4c9bc 100644 --- a/lib/WebGUI/Asset/Wobject/SQLReport.pm +++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm @@ -591,9 +591,12 @@ sub _processQuery { my $i18n = WebGUI::International->new($self->session,"Asset_SQLReport"); push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get(17).$query}); push(@{$self->{_debug_loop}},{'debug.output'=>$i18n->get('debug placeholder parameters').join(",",@$placeholderParams)}); - my $dbLink = WebGUI::DatabaseLink->new($self->session,$self->{_query}{$nr}{databaseLinkId}) - || return $self->session->errorHandler->error("Could not find database link '".$self->{_query}{$nr}{databaseLinkId}."'. Has it been created?"); - + my $dbLink = WebGUI::DatabaseLink->new($self->session,$self->{_query}{$nr}{databaseLinkId}); + if (!$dbLink) { + $self->session->errorHandler->error("Could not find database link '".$self->{_query}{$nr}{databaseLinkId}."'. Has it been created?"); + push @{$self->{_debug_loop}}, { 'debug.output' => 'Could not find database link'}; + return \%var; + } my $dbh = $dbLink->db; if (defined $dbh) { if ($dbLink->queryIsAllowed($query)) {