mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Fix error in D5634
Summary: The original code seemed to assume the last level of edges was the destination edge, when it was an array under the destination edge key. Using `array_keys` fixes the crashes that resulted when commits had tasks, projects or revisions attached. Test Plan: Open up a commit with a revision attached. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, vrana Differential Revision: https://secure.phabricator.com/D5698
This commit is contained in:
parent
bd350abbe9
commit
141228343c
1 changed files with 6 additions and 4 deletions
|
@ -360,14 +360,15 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
$user = $this->getRequest()->getUser();
|
$user = $this->getRequest()->getUser();
|
||||||
$commit_phid = $commit->getPHID();
|
$commit_phid = $commit->getPHID();
|
||||||
|
|
||||||
$edges = id(new PhabricatorEdgeQuery())
|
$edge_query = id(new PhabricatorEdgeQuery())
|
||||||
->withSourcePHIDs(array($commit_phid))
|
->withSourcePHIDs(array($commit_phid))
|
||||||
->withEdgeTypes(array(
|
->withEdgeTypes(array(
|
||||||
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK,
|
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK,
|
||||||
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT,
|
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_PROJECT,
|
||||||
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV,
|
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV,
|
||||||
))
|
));
|
||||||
->execute();
|
|
||||||
|
$edges = $edge_query->execute();
|
||||||
|
|
||||||
$task_phids = array_keys(
|
$task_phids = array_keys(
|
||||||
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
|
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_TASK]);
|
||||||
|
@ -376,7 +377,8 @@ final class DiffusionCommitController extends DiffusionController {
|
||||||
$revision_phid = key(
|
$revision_phid = key(
|
||||||
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV]);
|
$edges[$commit_phid][PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV]);
|
||||||
|
|
||||||
$phids = array_mergev($edges[$commit_phid]);
|
$phids = $edge_query->getDestinationPHIDs(array($commit_phid));
|
||||||
|
|
||||||
if ($data->getCommitDetail('authorPHID')) {
|
if ($data->getCommitDetail('authorPHID')) {
|
||||||
$phids[] = $data->getCommitDetail('authorPHID');
|
$phids[] = $data->getCommitDetail('authorPHID');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue