Fix two issues with unusual milestone workboard initialization orders

Summary: Fixes T10316. Fixes T10311.

Test Plan:
  - Create a project, create a milestone, go back to the parent, go to the workboard. Previously, fatal. Now, prompts you to create workboard.
  - Create a project, create a milestone, create the parent workboard, put a task in the milestone's column, go to the milestone workboard. Previously, fatal. Now, prompts you to create workboard.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10311, T10316

Differential Revision: https://secure.phabricator.com/D15232
This commit is contained in:
epriestley
2016-02-10 05:19:02 -08:00
parent c2502f1beb
commit 7bca452fad
2 changed files with 21 additions and 4 deletions

View File

@@ -126,11 +126,21 @@ final class PhabricatorProjectBoardViewController
$columns = $layout_engine->getColumns($board_phid);
if (!$columns || !$project->getHasWorkboard()) {
$has_normal_columns = false;
foreach ($columns as $column) {
if (!$column->getProxyPHID()) {
$has_normal_columns = true;
break;
}
}
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$project,
PhabricatorPolicyCapability::CAN_EDIT);
if (!$columns) {
if (!$has_normal_columns) {
if (!$can_edit) {
$content = $this->buildNoAccessContent($project);
} else {