From a1f08de283988192934342d435181498358b5074 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 13 May 2019 07:18:58 -0700 Subject: [PATCH] When viewing a workboard, only link to parent workboards in crumbs if parents have workboards Summary: Depends on D20516. See PHI1247. In D20331, I made the crumbs on workboards point at ancestor workboards. However, this isn't a great destination if an ancestor doesn't actually have a workboard. In this case, point at the normal profile URI instead. Test Plan: - Viewed a milestone workboard with a parent that had no workboard. Saw a profile link instead of a workboard link (new behavior). - Viewed a milestone workboard with a parent that also had a workboard. Saw a workboard link (existing old behavior still works). Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D20517 --- .../project/controller/PhabricatorProjectController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/project/controller/PhabricatorProjectController.php b/src/applications/project/controller/PhabricatorProjectController.php index a2e9916b82..8551a09cbf 100644 --- a/src/applications/project/controller/PhabricatorProjectController.php +++ b/src/applications/project/controller/PhabricatorProjectController.php @@ -109,7 +109,11 @@ abstract class PhabricatorProjectController extends PhabricatorController { } else { switch ($mode) { case 'workboard': - $crumb_uri = $ancestor->getWorkboardURI(); + if ($ancestor->getHasWorkboard()) { + $crumb_uri = $ancestor->getWorkboardURI(); + } else { + $crumb_uri = $ancestor->getProfileURI(); + } break; case 'profile': default: