# 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'}) {
#
# 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)
# 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. !
use Bugzilla::Error;
use Bugzilla::User;
use Bugzilla::Bug;
+use Bugzilla::BugMail;
use Bugzilla::Flag;
use Bugzilla::Field;
use Bugzilla::Group;
# 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} );
}
###########################################################################
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) {