From 7c8fde9aa61dc970c90cc193d1ab58af525f790f Mon Sep 17 00:00:00 2001
From: Colin Kuskie
Date: Sat, 4 Nov 2006 16:24:46 +0000
Subject: [PATCH] forward port of placeholder parameter fix
---
docs/changelog/7.x.x.txt | 1 +
lib/WebGUI/Asset/Wobject/SQLReport.pm | 8 ++++++--
lib/WebGUI/i18n/English/Asset_SQLReport.pm | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 5d7cf6558..6fe8f0933 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -31,6 +31,7 @@
- fix: WebGUI::Text::splitCsv no longer removes trailing empty fields
- fix: Product add-to-group would always try to add a user to a group
- Made many minor changes recommended by Perl::Critic.
+ - fix: No Integers or Strings as Placeholder Parameters
- Made many minor code efficiency changes.
- fix: Two cookies and incorrect Last-Modified date in HTTP header
- WebGUI::Text no longer spits out a billion warnings
diff --git a/lib/WebGUI/Asset/Wobject/SQLReport.pm b/lib/WebGUI/Asset/Wobject/SQLReport.pm
index 5b9092e67..eefd2d68f 100644
--- a/lib/WebGUI/Asset/Wobject/SQLReport.pm
+++ b/lib/WebGUI/Asset/Wobject/SQLReport.pm
@@ -515,8 +515,9 @@ sub _parsePlaceholderParams {
my $params = shift;
my @placeholderParams;
foreach my $row (split(/\n/,$params)) {
- chop($row) if ($row =~ m/\s+$/);
- next if ($row =~ /^\s*$/);
+ $row =~ s/^\s+//;
+ $row =~ s/\s+$//;
+ next if ($row eq '');
my ($type,$field) = split(/:/,$row);
my $param;
if($type =~ /^form/) {
@@ -524,6 +525,9 @@ sub _parsePlaceholderParams {
} elsif ($type =~ /^query(\d)/) {
$param = $self->{_query}{$1}{rowData}{$field};
}
+ else {
+ $param = $row;
+ }
WebGUI::Macro::process($self->session,\$param);
push(@placeholderParams, $param);
}
diff --git a/lib/WebGUI/i18n/English/Asset_SQLReport.pm b/lib/WebGUI/i18n/English/Asset_SQLReport.pm
index a31fc643b..cf5385ea9 100644
--- a/lib/WebGUI/i18n/English/Asset_SQLReport.pm
+++ b/lib/WebGUI/i18n/English/Asset_SQLReport.pm
@@ -56,9 +56,9 @@ Placeholder Parameters: query1:pageId
form:field1
In this example the first question mark will contain the field value of pageId in query1,
while the second question mark will contain the form variable "field1".
-Place one Placeholder Parameter on each line.
+Place one Placeholder Parameter on each line. Leading and trailing whitespace will be trimmed from each parameter.
|,
- lastUpdated => 1146785541,
+ lastUpdated => 1162613239,
},
'15 description' => {