summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-12-18 06:55:28 +0100
committerByron Jones <bjones@mozilla.com>2013-12-18 06:55:28 +0100
commited1e4230e934cd59962096b2c4621acf20d7c0f7 (patch)
treef8da97e35efd0a890fdc4bba278422abb3c52c6f /extensions
parent0947dc7814a092dd39a50b37de2a608b0fe9e1c6 (diff)
downloadbugzilla-ed1e4230e934cd59962096b2c4621acf20d7c0f7.tar.gz
bugzilla-ed1e4230e934cd59962096b2c4621acf20d7c0f7.tar.xz
Bug 951016: X-Bugzilla-Mentors missing from email
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Review/Extension.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index f15bdc9ef..c2951d29b 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -80,6 +80,7 @@ sub _bug_mentors {
if (!exists $self->{mentors}) {
my @mentors;
my $whiteboard = $self->status_whiteboard;
+ my $logout = 0;
while ($whiteboard =~ /\[mentor=([^\]]+)\]/g) {
my $mentor_string = $1;
my $user;
@@ -89,6 +90,13 @@ sub _bug_mentors {
} else {
# otherwise assume it's a : prefixed nick. only works if a
# single user matches.
+
+ # we need to be logged in to do user searching
+ if (!Bugzilla->user->id) {
+ Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ $logout = 1;
+ }
+
foreach my $query ("*:$mentor_string*", "*$mentor_string*") {
my $matches = Bugzilla::User::match($query, 2);
if ($matches && scalar(@$matches) == 1) {
@@ -99,6 +107,7 @@ sub _bug_mentors {
}
push @mentors, $user if $user;
}
+ Bugzilla->logout_request() if $logout;
$self->{mentors} = \@mentors;
}
return $self->{mentors};