From c0dc5ca898657e79727415c7b02e7e3ded2ecda9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Aug 2014 16:22:11 -0700 Subject: [PATCH] Clean up remaining default column logic for boards Summary: See D10189. We should never hit this anymore, so clean it up. Test Plan: - Reloaded a board, saw everything stay where it was before the change. - Added a new task to the project, saw it show up in backlog. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10200 --- .../PhabricatorProjectBoardViewController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php index 118593f39c..8e89881473 100644 --- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php +++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php @@ -166,17 +166,17 @@ final class PhabricatorProjectBoardViewController } $task_map = array(); - $default_phid = $columns[0]->getPHID(); foreach ($tasks as $task) { $task_phid = $task->getPHID(); - - $column_phid = null; - if (isset($positions[$task_phid])) { - $column_phid = $positions[$task_phid]->getColumnPHID(); + if (empty($positions[$task_phid])) { + // This shouldn't normally be possible because we create positions on + // demand, but we might have raced as an object was removed from the + // board. Just drop the task if we don't have a position for it. + continue; } - $column_phid = nonempty($column_phid, $default_phid); - $task_map[$column_phid][] = $task_phid; + $position = $positions[$task_phid]; + $task_map[$position->getColumnPHID()][] = $task_phid; } // If we're showing the board in "natural" order, sort columns by their