@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix a fatal during breadcrumb construction when viewing a dashboard you don't have permission to view

Summary: Ref PHI662. Viewing a dashboard you don't have permission to view (in the Dashboard application) currently fatals while building crumbs, since we fail to build the ` ... > Dashboard 123 > ...` crumb.

Test Plan:
- Viewed a dashboard I didn't have permission to view in the Dashboards application.
- Before patch, fatal when calling `getID()` on a non-object.
- After patch, sensible policy error page.
- Viewed a dashboard I can view, saw sensible crumbs.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19449

+8 -5
+8 -5
src/applications/dashboard/controller/PhabricatorDashboardProfileController.php
··· 44 44 } 45 45 46 46 protected function buildApplicationCrumbs() { 47 + $crumbs = parent::buildApplicationCrumbs(); 48 + $crumbs->setBorder(true); 49 + 47 50 $dashboard = $this->getDashboard(); 48 - $id = $dashboard->getID(); 49 - $dashboard_uri = $this->getApplicationURI("/view/{$id}/"); 51 + if ($dashboard) { 52 + $id = $dashboard->getID(); 53 + $dashboard_uri = $this->getApplicationURI("/view/{$id}/"); 54 + $crumbs->addTextCrumb($dashboard->getName(), $dashboard_uri); 55 + } 50 56 51 - $crumbs = parent::buildApplicationCrumbs(); 52 - $crumbs->addTextCrumb($dashboard->getName(), $dashboard_uri); 53 - $crumbs->setBorder(true); 54 57 return $crumbs; 55 58 } 56 59