Fix fatal on project boards with no tasks
Summary: Ref T1344. We try to do a bad edge query with no sources right now if there are no tasks in a project. Test Plan: - Hit exception, applied patch, no exception. - Other boards still have tasks. Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T1344 Differential Revision: https://secure.phabricator.com/D7951
This commit is contained in:
@@ -54,12 +54,14 @@ final class PhabricatorProjectBoardController
|
|||||||
->execute();
|
->execute();
|
||||||
$tasks = mpull($tasks, null, 'getPHID');
|
$tasks = mpull($tasks, null, 'getPHID');
|
||||||
|
|
||||||
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN;
|
if ($tasks) {
|
||||||
$edge_query = id(new PhabricatorEdgeQuery())
|
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN;
|
||||||
->withSourcePHIDs(mpull($tasks, 'getPHID'))
|
$edge_query = id(new PhabricatorEdgeQuery())
|
||||||
->withEdgeTypes(array($edge_type))
|
->withSourcePHIDs(mpull($tasks, 'getPHID'))
|
||||||
->withDestinationPHIDs(mpull($columns, 'getPHID'));
|
->withEdgeTypes(array($edge_type))
|
||||||
$edge_query->execute();
|
->withDestinationPHIDs(mpull($columns, 'getPHID'));
|
||||||
|
$edge_query->execute();
|
||||||
|
}
|
||||||
|
|
||||||
$task_map = array();
|
$task_map = array();
|
||||||
$default_phid = $columns[0]->getPHID();
|
$default_phid = $columns[0]->getPHID();
|
||||||
|
|||||||
Reference in New Issue
Block a user