summaryrefslogtreecommitdiffstats
path: root/new_bug.cgi
diff options
context:
space:
mode:
authorSebastin Santy <sebastinssanty@gmail.com>2017-07-17 19:44:37 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-17 19:44:37 +0200
commite08b1e57d8f4921821ba68ceea96c9eaaa1729f8 (patch)
treed6fa07d2b63ca26649554e3c100cf06d19e2f830 /new_bug.cgi
parentc7db6b60df0b555477fa08c9db2ee48fa1dd7c7a (diff)
downloadbugzilla-e08b1e57d8f4921821ba68ceea96c9eaaa1729f8.tar.gz
bugzilla-e08b1e57d8f4921821ba68ceea96c9eaaa1729f8.tar.xz
Bug 1381042 - new-bug doesn't properly engage the email generation machinery
Diffstat (limited to 'new_bug.cgi')
-rw-r--r--new_bug.cgi24
1 files changed, 24 insertions, 0 deletions
diff --git a/new_bug.cgi b/new_bug.cgi
index fd4b5520a..8462bb6ff 100644
--- a/new_bug.cgi
+++ b/new_bug.cgi
@@ -36,6 +36,9 @@ use Bugzilla::Token;
use Bugzilla::Field;
use Bugzilla::Status;
use Bugzilla::UserAgent;
+use Bugzilla::BugMail;
+
+use List::MoreUtils qw(uniq);
my $user = Bugzilla->login(LOGIN_REQUIRED);
@@ -59,6 +62,27 @@ if (lc($cgi->request_method) eq 'post') {
comment => scalar($cgi->param('comment')),
});
delete_token($token);
+
+ my $recipients = { changer => $user };
+ my $bug_sent = Bugzilla::BugMail::Send($new_bug->bug_id, $recipients);
+ $bug_sent->{type} = 'created';
+ $bug_sent->{id} = $new_bug->bug_id;
+ my @all_mail_results = ($bug_sent);
+
+ foreach my $dep (@{$new_bug->dependson || []}, @{$new_bug->blocked || []}) {
+ my $dep_sent = Bugzilla::BugMail::Send($dep, $recipients);
+ $dep_sent->{type} = 'dep';
+ $dep_sent->{id} = $dep;
+ push(@all_mail_results, $dep_sent);
+ }
+
+ # Sending emails for any referenced bugs.
+ foreach my $ref_bug_id (uniq @{ $new_bug->{see_also_changes} || [] }) {
+ my $ref_sent = Bugzilla::BugMail::Send($ref_bug_id, $recipients);
+ $ref_sent->{id} = $ref_bug_id;
+ push(@all_mail_results, $ref_sent);
+ }
+
print $cgi->redirect(correct_urlbase() . 'show_bug.cgi?id='.$new_bug->bug_id);
} else {
print $cgi->header();