summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authorcyeh%bluemartini.com <>2001-02-16 07:42:13 +0100
committercyeh%bluemartini.com <>2001-02-16 07:42:13 +0100
commitb567f4256283d1865d2517bde2293da0365e1a24 (patch)
treef835ddab95bf3191cc3bd2dbe4e2f9e5d5611af4 /process_bug.cgi
parent10ad2870e57c3f3de63e1b6fa4375af1d660f412 (diff)
downloadbugzilla-b567f4256283d1865d2517bde2293da0365e1a24.tar.gz
bugzilla-b567f4256283d1865d2517bde2293da0365e1a24.tar.xz
fix for 28676 :
When a bug is marked duplicate, the reporter should be added to the bug that it duplicated. patch submitted by jake@acutex.net (Jake).
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi22
1 files changed, 22 insertions, 0 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 256e1cd34..fbcac44a8 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -545,6 +545,28 @@ SWITCH: for ($::FORM{'knob'}) {
PuntTryAgain("The bug id $::FORM{'id'} is invalid. Please reload this bug ".
"and try again.");
}
+ # Check to see if Reporter of this bug is reporter of Dupe
+ SendSQL("SELECT reporter FROM bugs WHERE bug_id = " . SqlQuote($::FORM{'id'}));
+ my $reporter = FetchOneColumn();
+ SendSQL("SELECT reporter FROM bugs WHERE bug_id = " . SqlQuote($num) . " and reporter = $reporter");
+ my $isreporter = FetchOneColumn();
+ SendSQL("SELECT who FROM cc WHERE bug_id = " . SqlQuote($num) . " and who = $reporter");
+ my $isoncc = FetchOneColumn();
+ unless ($isreporter || $isoncc) {
+ # The reporter is oblivious to the existance of the new bug... add 'em to the cc (and record activity)
+ SendSQL("SELECT who FROM cc WHERE bug_id = " . SqlQuote($num));
+ my @dupecc;
+ while (MoreSQLData()) {
+ push (@dupecc, DBID_to_name(FetchOneColumn()));
+ }
+ my @newdupecc = @dupecc;
+ push (@newdupecc, DBID_to_name($reporter));
+ my $ccid = GetFieldID("cc");
+ my $whochange = DBNameToIdAndCheck($::FORM{'who'});
+ SendSQL("INSERT INTO bugs_activity (bug_id,who,bug_when,fieldid,oldvalue,newvalue) VALUES " .
+ "('$num','$whochange',now(),$ccid,'" . join (",", sort @dupecc) . "','" . join (",", sort @newdupecc) . "')");
+ SendSQL("INSERT INTO cc (who, bug_id) VALUES ($reporter, " . SqlQuote($num) . ")");
+ }
AppendComment($num, $::FORM{'who'}, "*** Bug $::FORM{'id'} has been marked as a duplicate of this bug. ***");
if ( Param('strictvaluechecks') ) {
CheckFormFieldDefined(\%::FORM,'comment');