mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
Fix some issue with "Move on Workboard" and workboard-less or invisible projects
Summary: Ref T6027. Fixes T10734. - If one of the projects a task is tagged with isn't visible to the user or doesn't have a board, it won't have columns. - Don't show options for projects with disabled boards. Test Plan: - Viewed task with project with no columns; no fatal. - Viewed task with project with disabled board; no options to move on that board. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10734, T6027 Differential Revision: https://secure.phabricator.com/D15640
This commit is contained in:
parent
4d32c990ab
commit
2ae8e57cf1
1 changed files with 9 additions and 2 deletions
|
@ -394,7 +394,6 @@ EODOCS
|
|||
->setViewer($viewer)
|
||||
->setBoardPHIDs($board_phids)
|
||||
->setObjectPHIDs(array($task->getPHID()))
|
||||
->setFetchAllBoards(true)
|
||||
->executeLayout();
|
||||
|
||||
$map = array();
|
||||
|
@ -403,6 +402,14 @@ EODOCS
|
|||
$in_columns = mpull($in_columns, null, 'getPHID');
|
||||
|
||||
$all_columns = $layout_engine->getColumns($board_phid);
|
||||
if (!$all_columns) {
|
||||
// This could be a project with no workboard, or a project the viewer
|
||||
// does not have permission to see.
|
||||
continue;
|
||||
}
|
||||
|
||||
$board = head($all_columns)->getProject();
|
||||
|
||||
$options = array();
|
||||
foreach ($all_columns as $column) {
|
||||
$name = $column->getDisplayName();
|
||||
|
@ -439,7 +446,7 @@ EODOCS
|
|||
}
|
||||
|
||||
$map[] = array(
|
||||
'label' => head($all_columns)->getProject()->getDisplayName(),
|
||||
'label' => $board->getDisplayName(),
|
||||
'options' => $options,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue