From 2ae8e57cf110557c9355419a698a04b4dc46ab32 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 6 Apr 2016 10:05:07 -0700 Subject: [PATCH] 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 --- .../maniphest/editor/ManiphestEditEngine.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/applications/maniphest/editor/ManiphestEditEngine.php b/src/applications/maniphest/editor/ManiphestEditEngine.php index 58606538ca..8e5893a9b8 100644 --- a/src/applications/maniphest/editor/ManiphestEditEngine.php +++ b/src/applications/maniphest/editor/ManiphestEditEngine.php @@ -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, ); }