]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 353623: SanityCheck 'rescanallbugmail' parameter not working (no 'changer' specif...
authorlpsolit%gmail.com <>
Sat, 23 Sep 2006 06:14:53 +0000 (06:14 +0000)
committerlpsolit%gmail.com <>
Sat, 23 Sep 2006 06:14:53 +0000 (06:14 +0000)
Bugzilla/BugMail.pm
contrib/bug_email.pl
editusers.cgi
sanitycheck.cgi

index e78be86ec0ff3d0cc57e21b170519fd7a303579e..49615c5962f3f82ece1a7496267f007cd2c6a9a4 100644 (file)
@@ -168,7 +168,10 @@ sub ProcessOneBug {
     
     # Convert to names, for later display
     $values{'changer'} = $changer;
-    $values{'changername'} = Bugzilla::User->new({name => $changer})->name;
+    # If no changer is specified, then it has no name.
+    if ($changer) {
+        $values{'changername'} = Bugzilla::User->new({name => $changer})->name;
+    }
     $values{'assigned_to'} = user_id_to_login($values{'assigned_to'});
     $values{'reporter'} = user_id_to_login($values{'reporter'});
     if ($values{'qa_contact'}) {
index d2fc91b66c6cc7d47f73068866ecf8e77e199e72..0f898da52e9ff18e7e8b61abab749013828e044d 100755 (executable)
@@ -38,7 +38,7 @@
 #
 # You need to work with bug_email.pl the MIME::Parser installed.
 # 
-# $Id: bug_email.pl,v 1.44 2006/07/03 21:42:47 mkanat%bugzilla.org Exp $
+# $Id: bug_email.pl,v 1.45 2006/09/22 23:14:53 lpsolit%gmail.com Exp $
 ###############################################################
 
 # 02/12/2000 (SML)
@@ -1173,7 +1173,7 @@ END
     # Send the 'you did it'-reply
     Reply( $SenderShort, $Message_ID,"Bugzilla success (ID $id)", $reply );
 
-    Bugzilla::BugMail::Send($id) if( ! $test);
+    Bugzilla::BugMail::Send($id, {'changer' => $reporter}) if (!$test);
     
 } else {
     # There were critical errors in the mail - the bug couldn't be inserted. !
index 9baf0050ff7fdeac18bbc31a28f856e9f11ea640..f30c667464261bc9b305fb4f815083d2b5d03c7e 100755 (executable)
@@ -29,6 +29,7 @@ use Bugzilla::Util;
 use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Bug;
+use Bugzilla::BugMail;
 use Bugzilla::Flag;
 use Bugzilla::Field;
 use Bugzilla::Group;
@@ -716,7 +717,7 @@ if ($action eq 'search') {
     # Send mail about what we've done to bugs.
     # The deleted user is not notified of the changes.
     foreach (keys(%updatedbugs)) {
-        Bugzilla::BugMail::Send($_);
+        Bugzilla::BugMail::Send($_, {'changer' => $user->login} );
     }
 
 ###########################################################################
index 1c7ab284f1862347eb1fe2755d9747fda15a9da2..dd9e50598c7702ffd5dc2e727309286f152c62f0 100755 (executable)
@@ -233,9 +233,19 @@ if (defined $cgi->param('rescanallBugMail')) {
                                       ORDER BY bug_id});
          
     Status(scalar(@$list) . ' bugs found with possibly unsent mail.');
-      
+
+    my $vars = {};
+    # We cannot simply look at the bugs_activity table to find who did the
+    # last change in a given bug, as e.g. adding a comment doesn't add any
+    # entry to this table. And some other changes may be private
+    # (such as time-related changes or private attachments or comments)
+    # and so choosing this user as being the last one having done a change
+    # for the bug may be problematic. So the best we can do at this point
+    # is to choose the currently logged in user for email notification.
+    $vars->{'changer'} = Bugzilla->user->login;
+
     foreach my $bugid (@$list) {
-        Bugzilla::BugMail::Send($bugid);
+        Bugzilla::BugMail::Send($bugid, $vars);
     }
 
     if (scalar(@$list) > 0) {