1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

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:
epriestley 2014-01-13 14:25:05 -08:00
parent f574100315
commit 8a7429b879

View file

@ -54,12 +54,14 @@ final class PhabricatorProjectBoardController
->execute();
$tasks = mpull($tasks, null, 'getPHID');
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN;
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($tasks, 'getPHID'))
->withEdgeTypes(array($edge_type))
->withDestinationPHIDs(mpull($columns, 'getPHID'));
$edge_query->execute();
if ($tasks) {
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_COLUMN;
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($tasks, 'getPHID'))
->withEdgeTypes(array($edge_type))
->withDestinationPHIDs(mpull($columns, 'getPHID'));
$edge_query->execute();
}
$task_map = array();
$default_phid = $columns[0]->getPHID();