summaryrefslogtreecommitdiffstats
path: root/extensions/PhabBugz/lib/User.pm
diff options
context:
space:
mode:
authordklawren <dklawren@users.noreply.github.com>2018-05-11 19:10:09 +0200
committerGitHub <noreply@github.com>2018-05-11 19:10:09 +0200
commita1d7038494ee5fb327b21b48c7d1e5fb75b39e72 (patch)
tree8c88e015e615ee3801092d30d7e5ba6d87059c18 /extensions/PhabBugz/lib/User.pm
parenta5b780358d0e8c9cd611a644b3d6168daac711e3 (diff)
downloadbugzilla-a1d7038494ee5fb327b21b48c7d1e5fb75b39e72.tar.gz
bugzilla-a1d7038494ee5fb327b21b48c7d1e5fb75b39e72.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},