summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz/lib/User.pm
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-05-08 16:15:48 +0200
committerDylan William Hardison <dylan@hardison.net>2018-05-08 16:15:48 +0200
commit739676cf4b122cdec12981c2bc3a79c3f54aa7e4 (patch)
tree41704ac6f5280613a4789281bda54f2cee547d0f /extensions/PhabBugz/lib/User.pm
parent2eea01b5c298e24127d26ba1e99bf01772579f2a (diff)
downloadbugzilla-739676cf4b122cdec12981c2bc3a79c3f54aa7e4.tar.gz
bugzilla-739676cf4b122cdec12981c2bc3a79c3f54aa7e4.tar.xz
Bug 1440086 - Refactor PhabBugz extension code to use new User.pm module for better type checking
Diffstat (limited to 'extensions/PhabBugz/lib/User.pm')
-rw-r--r--extensions/PhabBugz/lib/User.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/extensions/PhabBugz/lib/User.pm b/extensions/PhabBugz/lib/User.pm
index 3b2d87e60..9d4e9eef4 100644
--- a/extensions/PhabBugz/lib/User.pm
+++ b/extensions/PhabBugz/lib/User.pm
@@ -116,14 +116,14 @@ sub match {
my ( $class, $params ) = @_;
# BMO id search takes precedence if bugzilla_ids is used.
- my $bugzilla_ids = delete $params->{bugzilla_ids};
+ my $bugzilla_ids = delete $params->{ids};
if ($bugzilla_ids) {
my $bugzilla_data =
$class->get_phab_bugzilla_ids( { ids => $bugzilla_ids } );
$params->{phids} = [ map { $_->{phid} } @$bugzilla_data ];
}
- return [] if !$params->{phids};
+ return [] if !@{ $params->{phids} };
# Look for BMO external user id in external-accounts attachment
my $data = {
@@ -177,6 +177,7 @@ sub get_phab_bugzilla_ids {
# Store new values in memcache for later retrieval
foreach my $user ( @{ $result->{result} } ) {
+ next if !$user->{phid};
$memcache->set(
{
key => "phab_user_bugzilla_id_" . $user->{id},