summaryrefslogtreecommitdiffstats
path: root/post_bug.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-04-16 08:16:59 +0200
committergerv%gerv.net <>2002-04-16 08:16:59 +0200
commit8b98fa786bc502448bd11773c9fde60fafdfcc7a (patch)
tree4b13c830e6205a85705e71ceb10afceb9f7b8bdf /post_bug.cgi
parent19b8a53a63d56d205f39efe20ce3ab7ba5fec0e8 (diff)
downloadbugzilla-8b98fa786bc502448bd11773c9fde60fafdfcc7a.tar.gz
bugzilla-8b98fa786bc502448bd11773c9fde60fafdfcc7a.tar.xz
Bug 121247 - enter_bug comment templates. Template method for amalgamation of free-form enter_bug text fields into the description. Patch by gerv; 2xr=myk.
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-xpost_bug.cgi12
1 files changed, 10 insertions, 2 deletions
diff --git a/post_bug.cgi b/post_bug.cgi
index dd6b5b366..7f9f46c47 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -51,7 +51,16 @@ use vars qw($vars $template);
confirm_login();
-ValidateComment($::FORM{'comment'});
+
+# The format of the initial comment can be structured by adding fields to the
+# enter_bug template and then referencing them in the comment template.
+my $comment;
+
+$vars->{'form'} = \%::FORM;
+$template->process("entry/comment.txt.tmpl", $vars, \$comment)
+ || ThrowTemplateError($template->error());
+
+ValidateComment($comment);
my $product = $::FORM{'product'};
@@ -197,7 +206,6 @@ foreach my $field (@used_fields) {
$sql .= SqlQuote($::FORM{$field}) . ",";
}
-my $comment = $::FORM{'comment'};
$comment =~ s/\r\n?/\n/g; # Get rid of \r.
$comment = trim($comment);
# If comment is all whitespace, it'll be null at this point. That's