]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 343050: process_bug.cgi tries to send emails to too many bugs - Patch by Frédéric...
authorlpsolit%gmail.com <>
Sat, 19 Aug 2006 00:32:11 +0000 (00:32 +0000)
committerlpsolit%gmail.com <>
Sat, 19 Aug 2006 00:32:11 +0000 (00:32 +0000)
process_bug.cgi

index b26352d227664cb4d00e8c23033c16efad6efb8c..156f756209e523a15b821a281fc0e078bac5f81d 100755 (executable)
@@ -1726,12 +1726,16 @@ foreach my $id (@idlist) {
         my @oldlist = @{$dbh->selectcol_arrayref("SELECT $target FROM dependencies
                                                   WHERE $me = ? ORDER BY $target",
                                                   undef, $id)};
-        @dependencychanged{@oldlist} = 1;
+
+        # Only bugs depending on the current one should get notification.
+        # Bugs blocking the current one never get notification, unless they
+        # are added or removed from the dependency list. This case is treated
+        # below.
+        @dependencychanged{@oldlist} = 1 if ($me eq 'dependson');
 
         if (defined $cgi->param($target)) {
             my %snapshot;
             my @newlist = sort {$a <=> $b} @{$deps{$target}};
-            @dependencychanged{@newlist} = 1;
 
             while (0 < @oldlist || 0 < @newlist) {
                 if (@oldlist == 0 || (@newlist > 0 &&
@@ -1768,6 +1772,9 @@ foreach my $id (@idlist) {
                 }
                 LogDependencyActivity($id, $oldsnap, $target, $me, $timestamp);
                 $check_dep_bugs = 1;
+                # All bugs added or removed from the dependency list
+                # must be notified.
+                @dependencychanged{@keys} = 1;
             }
         }
     }