summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-06 01:26:09 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-06 01:26:09 +0200
commitd74d76b0730621b09571775902899d7030ca3150 (patch)
treedfeb8f80dc10cd0e25e0c7ae89f8dd48677db9b6 /attachment.cgi
parent3b351275ab6f8090620234dd2b3ee8a9ef72e599 (diff)
downloadbugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.gz
bugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.xz
Bug 556429: Stop sending bugmail from inside the template
r=LpSolit, a=LpSolit
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi13
1 files changed, 9 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi
index f85fb3a19..0b389501b 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -39,6 +39,7 @@ use strict;
use lib qw(. lib);
use Bugzilla;
+use Bugzilla::BugMail;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Flag;
@@ -532,8 +533,6 @@ sub insert {
$dbh->bz_commit_transaction;
# Define the variables and functions that will be passed to the UI template.
- $vars->{'mailrecipients'} = { 'changer' => $user->login,
- 'owner' => $owner };
$vars->{'attachment'} = $attachment;
# We cannot reuse the $bug object as delta_ts has eventually been updated
# since the object was created.
@@ -541,6 +540,9 @@ sub insert {
$vars->{'header_done'} = 1;
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
+ my $recipients = { 'changer' => $user->login, 'owner' => $owner };
+ $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients);
+
print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/created.html.tmpl", $vars)
@@ -662,10 +664,11 @@ sub update {
$dbh->bz_commit_transaction();
# Define the variables and functions that will be passed to the UI template.
- $vars->{'mailrecipients'} = { 'changer' => $user->login };
$vars->{'attachment'} = $attachment;
$vars->{'bugs'} = [$bug];
$vars->{'header_done'} = 1;
+ $vars->{'sent_bugmail'} =
+ Bugzilla::BugMail::Send($bug->id, { 'changer' => $user->login });
print $cgi->header();
@@ -714,7 +717,6 @@ sub delete_attachment {
$vars->{'attachment'} = $attachment;
$vars->{'date'} = $date;
$vars->{'reason'} = clean_text($cgi->param('reason') || '');
- $vars->{'mailrecipients'} = { 'changer' => $user->login };
$template->process("attachment/delete_reason.txt.tmpl", $vars, \$msg)
|| ThrowTemplateError($template->error());
@@ -738,6 +740,9 @@ sub delete_attachment {
$vars->{'bugs'} = [$bug];
$vars->{'header_done'} = 1;
+ $vars->{'sent_bugmail'} =
+ Bugzilla::BugMail::Send($bug->id, { 'changer' => $user->login });
+
$template->process("attachment/updated.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
}