diff options
Diffstat (limited to 'extensions/PhabBugz/lib')
-rw-r--r-- | extensions/PhabBugz/lib/Util.pm | 10 | ||||
-rw-r--r-- | extensions/PhabBugz/lib/WebService.pm | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm index cc26f4d89..cbbca7eab 100644 --- a/extensions/PhabBugz/lib/Util.pm +++ b/extensions/PhabBugz/lib/Util.pm @@ -27,20 +27,20 @@ our @EXPORT = qw( get_bug_role_phids get_members_by_bmo_id get_project_phid - get_revision_by_id + get_revisions_by_ids intersect make_revision_public request set_project_members ); -sub get_revision_by_id { - my $id = shift; +sub get_revisions_by_ids { + my ($ids) = @_; my $data = { queryKey => 'all', constraints => { - ids => [ int($id) ] + ids => $ids } }; @@ -49,7 +49,7 @@ sub get_revision_by_id { ThrowUserError('invalid_phabricator_revision_id') unless (exists $result->{result}{data} && @{ $result->{result}{data} }); - return $result->{result}{data}[0]; + return @{$result->{result}{data}}; } sub create_revision_attachment { diff --git a/extensions/PhabBugz/lib/WebService.pm b/extensions/PhabBugz/lib/WebService.pm index 0e2574582..a8312dc8e 100644 --- a/extensions/PhabBugz/lib/WebService.pm +++ b/extensions/PhabBugz/lib/WebService.pm @@ -27,7 +27,7 @@ use Bugzilla::Extension::PhabBugz::Util qw( edit_revision_policy get_bug_role_phids get_project_phid - get_revision_by_id + get_revisions_by_ids intersect make_revision_public request @@ -50,7 +50,8 @@ sub revision { # Obtain more information about the revision from Phabricator my $revision_id = $params->{revision}; - my $revision = get_revision_by_id($revision_id); + my $revisions = get_revisions_by_ids([$revision_id]); + my $revision = $revisions->[0]; my $revision_phid = $revision->{phid}; my $revision_title = $revision->{fields}{title} || 'Unknown Description'; |