diff options
author | David Lawrence <dkl@mozilla.com> | 2014-10-28 04:23:51 +0100 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-10-28 04:23:51 +0100 |
commit | 83eac0c239ca39448417d9571d6262565e530baa (patch) | |
tree | 90b6c2b2dee0487847d141c1c3c306def2095cef | |
parent | 713077faaf9c0dde1e1f6e5e5d510723287ee193 (diff) | |
download | bugzilla-83eac0c239ca39448417d9571d6262565e530baa.tar.gz bugzilla-83eac0c239ca39448417d9571d6262565e530baa.tar.xz |
Bug 1076746: Mentor field is missing in the email when a bug gets created
-rw-r--r-- | Bugzilla/BugMail.pm | 11 | ||||
-rw-r--r-- | extensions/Review/Extension.pm | 10 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 9980535ce..59b911878 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -619,7 +619,16 @@ sub _get_new_bugmail_fields { my $value = $bug->$name; if (ref $value eq 'ARRAY') { - $value = join(', ', @$value); + my @new_values; + foreach my $item (@$value) { + if (blessed($item) && $item->isa('Bugzilla::User')) { + push(@new_values, $item->login); + } + else { + push(@new_values, $item); + } + } + $value = join(', ', @new_values); } elsif (blessed($value) && $value->isa('Bugzilla::User')) { $value = $value->login; diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm index f6a3bf743..d7498f18a 100644 --- a/extensions/Review/Extension.pm +++ b/extensions/Review/Extension.pm @@ -36,6 +36,7 @@ BEGIN { *Bugzilla::Component::reviewers_objs = \&_component_reviewers_objs; *Bugzilla::Bug::mentors = \&_bug_mentors; *Bugzilla::Bug::bug_mentors = \&_bug_mentors; + *Bugzilla::Bug::bug_mentor = \&_bug_mentors; *Bugzilla::Bug::is_mentor = \&_bug_is_mentor; *Bugzilla::Bug::set_bug_mentors = \&_bug_set_bug_mentors; *Bugzilla::User::review_count = \&_user_review_count; @@ -920,10 +921,15 @@ sub install_update_db { my $field = Bugzilla::Field->new({ name => 'bug_mentor' }); if (!$field) { Bugzilla::Field->create({ - name => 'bug_mentor', - description => 'Mentor' + name => 'bug_mentor', + description => 'Mentor', + mailhead => 1 }); } + elsif (!$field->in_new_bugmail) { + $field->set_in_new_bugmail(1); + $field->update(); + } } sub install_filesystem { |