From 99457cc8631ec71dcacb4e79b1597c0f8b9abd25 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 20 Mar 2014 20:57:18 +0000 Subject: Bug 986124 - backport upstream bug 513212 to bmo/4.2 to add the ability to add see_also values in enter_bug.cgi and Bug.create --- post_bug.cgi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'post_bug.cgi') diff --git a/post_bug.cgi b/post_bug.cgi index 7907d7037..a1ed77bac 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -43,6 +43,8 @@ use Bugzilla::Keyword; use Bugzilla::Token; use Bugzilla::Flag; +use List::MoreUtils qw(uniq); + my $user = Bugzilla->login(LOGIN_REQUIRED); my $cgi = Bugzilla->cgi; @@ -128,7 +130,7 @@ push(@bug_fields, qw( version target_milestone status_whiteboard - + see_also estimated_time deadline )); @@ -239,12 +241,21 @@ my $bug_sent = Bugzilla::BugMail::Send($id, $recipients); $bug_sent->{type} = 'created'; $bug_sent->{id} = $id; my @all_mail_results = ($bug_sent); + foreach my $dep (@{$bug->dependson || []}, @{$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 @{ $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); +} + $vars->{sentmail} = \@all_mail_results; $format = $template->get_format("bug/create/created", -- cgit v1.2.3-24-g4f1b