summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-02-04 17:50:52 +0100
committerByron Jones <glob@mozilla.com>2015-02-04 17:50:52 +0100
commitbb4b3f6727496aba5ba2633edc5fbc6746031465 (patch)
treeca21b1443ff2b4c774fee111481c7b4e4469daa0
parente1509ebba8b57781780a75f7dfdc6d9dd5989909 (diff)
downloadbugzilla-bb4b3f6727496aba5ba2633edc5fbc6746031465.tar.gz
bugzilla-bb4b3f6727496aba5ba2633edc5fbc6746031465.tar.xz
Bug 1129183: 500 internal server error with duplicate mentor field
-rw-r--r--extensions/Review/Extension.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index d7498f18a..9eb831071 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -139,7 +139,9 @@ sub object_validators {
sub _bug_check_bug_mentors {
my ($self, $value) = @_;
+ my %seen;
return [
+ grep { !$seen{$_->id}++ }
map { Bugzilla::User->check({ name => $_, cache => 1 }) }
ref($value) ? @$value : ($value)
];
@@ -267,7 +269,9 @@ sub _new_users_from_input {
return [] unless $input_params->{$field};
Bugzilla::User::match_field({ $field => {'type' => 'multi'} });;
my $value = $input_params->{$field};
+ my %seen;
return [
+ grep { !$seen{$_->id}++ }
map { Bugzilla::User->check({ name => $_, cache => 1 }) }
ref($value) ? @$value : ($value)
];