diff options
author | David Walsh <davidwalsh83@gmail.com> | 2017-07-19 22:03:44 +0200 |
---|---|---|
committer | dklawren <dklawren@users.noreply.github.com> | 2017-07-19 22:03:44 +0200 |
commit | d88236d240358a239d3020066cb2a5806fb27e0e (patch) | |
tree | b8424083885704028fbe056f98c423635898adf2 /extensions/PhabBugz/lib | |
parent | bd5ae5e8e17f448e77766bbb1fdd09ba5e9230ec (diff) | |
download | bugzilla-d88236d240358a239d3020066cb2a5806fb27e0e.tar.gz bugzilla-d88236d240358a239d3020066cb2a5806fb27e0e.tar.xz |
Bug 1380727 - Update BMO Push Connector to Make Revisions Public when Bug Made Public
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'; |