1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00

Fix phid accumulation for handles

Summary: I goofed this, $phids was already being populated and I changed the
meaning. This causes a fatal if you filter the list by a user who is not an
author or first reviewer for any of the revisions (e.g., no open revisions).

Test Plan: Looked at the list of a user with no revisions.

Reviewers: codeblock, jungejason

Reviewed By: codeblock

CC: aran, codeblock, jungejason

Differential Revision: 989
This commit is contained in:
epriestley 2011-10-07 12:03:24 -07:00
parent 8ce5dd31f6
commit c29982acb9

View file

@ -158,15 +158,10 @@ class DifferentialRevisionListController extends DifferentialController {
phutil_escape_html($filter_desc['name']))); phutil_escape_html($filter_desc['name'])));
} }
$phids = array();
$phids[$view_phid] = true;
$rev_ids = array(); $rev_ids = array();
foreach ($queries as $key => $query) { foreach ($queries as $key => $query) {
$revisions = $query['object']->loadRevisions(); $revisions = $query['object']->loadRevisions();
foreach ($revisions as $revision) { foreach ($revisions as $revision) {
$phids[$revision->getAuthorPHID()] = true;
$rev_ids[$revision->getID()] = true; $rev_ids[$revision->getID()] = true;
} }
$queries[$key]['revisions'] = $revisions; $queries[$key]['revisions'] = $revisions;
@ -204,6 +199,8 @@ class DifferentialRevisionListController extends DifferentialController {
$queries[$key]['view'] = $view; $queries[$key]['view'] = $view;
} }
$phids = array_mergev($phids); $phids = array_mergev($phids);
$phids[] = $view_phid;
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles(); $handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
foreach ($queries as $query) { foreach ($queries as $query) {