Skip to content

Commit 83eac0c

Browse files
committed
Bug 1076746: Mentor field is missing in the email when a bug gets created
1 parent 713077f commit 83eac0c

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Bugzilla/BugMail.pm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,16 @@ sub _get_new_bugmail_fields {
619619
my $value = $bug->$name;
620620

621621
if (ref $value eq 'ARRAY') {
622-
$value = join(', ', @$value);
622+
my @new_values;
623+
foreach my $item (@$value) {
624+
if (blessed($item) && $item->isa('Bugzilla::User')) {
625+
push(@new_values, $item->login);
626+
}
627+
else {
628+
push(@new_values, $item);
629+
}
630+
}
631+
$value = join(', ', @new_values);
623632
}
624633
elsif (blessed($value) && $value->isa('Bugzilla::User')) {
625634
$value = $value->login;

extensions/Review/Extension.pm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ BEGIN {
3636
*Bugzilla::Component::reviewers_objs = \&_component_reviewers_objs;
3737
*Bugzilla::Bug::mentors = \&_bug_mentors;
3838
*Bugzilla::Bug::bug_mentors = \&_bug_mentors;
39+
*Bugzilla::Bug::bug_mentor = \&_bug_mentors;
3940
*Bugzilla::Bug::is_mentor = \&_bug_is_mentor;
4041
*Bugzilla::Bug::set_bug_mentors = \&_bug_set_bug_mentors;
4142
*Bugzilla::User::review_count = \&_user_review_count;
@@ -920,10 +921,15 @@ sub install_update_db {
920921
my $field = Bugzilla::Field->new({ name => 'bug_mentor' });
921922
if (!$field) {
922923
Bugzilla::Field->create({
923-
name => 'bug_mentor',
924-
description => 'Mentor'
924+
name => 'bug_mentor',
925+
description => 'Mentor',
926+
mailhead => 1
925927
});
926928
}
929+
elsif (!$field->in_new_bugmail) {
930+
$field->set_in_new_bugmail(1);
931+
$field->update();
932+
}
927933
}
928934

929935
sub install_filesystem {

0 commit comments

Comments
 (0)