From 8667876f634f33cb347797904411ed317a4f89b3 Mon Sep 17 00:00:00 2001
From: Colin Kuskie
Date: Thu, 14 Jan 2010 08:30:17 -0800
Subject: [PATCH] Fix an i18n typo in the SQL Report, and also make sure that a
query is not pure whitespace. Fixes bug #11348.
---
docs/changelog/7.x.x.txt | 1 +
lib/WebGUI/Asset/Wobject/SQLReport.pm | 6 +++---
lib/WebGUI/i18n/English/Asset_SQLReport.pm | 4 ++++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 75eeb5ca2..a78545924 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -5,6 +5,7 @@
- fixed #11343: Notify About Low Stock workflow activity not sending out emails
- fixed #11345: New Image Asset template does now work well with AssetProxy macro and some layouts
- fixed #11344: Badge Builder doesn't allow pagination
+ - fixed #11348: Typ-o in debug notice SQLReport
7.8.9
- fixed #11235: wiki search
diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm
index 53fd221a8..1d74e3dd9 100644
--- a/lib/WebGUI/Asset/Wobject/SQLReport.pm
+++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm
@@ -649,14 +649,15 @@ sub _processQuery {
$page = 1 unless defined $page;
my $nr = shift || 1;
my ($query, %var, $prefix);
+ my $i18n = WebGUI::International->new($self->session,"Asset_SQLReport");
if($nr > 1) {
$prefix = 'query'.$nr.'.';
}
- if (! $self->{_query}{$nr}{dbQuery}) {
+ if (! $self->{_query}{$nr}{dbQuery} || $self->{_query}{$nr}{dbQuery} =~ m{\A \s* \Z}msx) {
$self->session->errorHandler->warn("No query specified for query $nr on '" . $self->getId . "'");
- push @{$self->{_debug_loop}}, { 'debug.output' => "No query specfied for query $nr" };
+ push @{$self->{_debug_loop}}, { 'debug.output' => sprintf($i18n->get('No query specified for query'), $nr) };
return \%var;
}
@@ -671,7 +672,6 @@ sub _processQuery {
$query = $self->{_query}{$nr}{dbQuery};
}
- 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});
diff --git a/lib/WebGUI/i18n/English/Asset_SQLReport.pm b/lib/WebGUI/i18n/English/Asset_SQLReport.pm
index cd8270e6b..cf6786e3a 100644
--- a/lib/WebGUI/i18n/English/Asset_SQLReport.pm
+++ b/lib/WebGUI/i18n/English/Asset_SQLReport.pm
@@ -74,6 +74,10 @@ while the second question mark will contain the form variable "field1".
message => q|Debug: Query:|,
lastUpdated => 1031514049
},
+ 'No query specified for query' => {
+ message => q|No query specified for query %s|,
+ lastUpdated => 1263483624,
+ },
'debug placeholder parameters' => {
message => q|Debug: Processed Placeholder parameters:|,
lastUpdated => 1031514049