@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.

Degrade more gracefully when ProfileMenu dashboards fail to render

Summary:
Ref T12871. This replaces a dead end UI (user totally locked out) with one where the menu is still available, if the default menu item is one which generates a policy exception (e.g., because users can't see the dashboard).

Really, we should do better than this and not select this item as the default item if the viewer can't see it, but there is currently no reliable way to test for "can the viewer see this item?" so this is a more involved change. I'm thinking we get this minor improvement into the release, then pursue a more detailed fix afterward.

Test Plan:
- Added a dashboard as the top item in the global menu.
- Changed the dashboard to be visible to only user B.
- Viewed Home as user A.
- Before patch: entire page is a policy exception dialog.
- After patch, things are better:

{F5014179}

Reviewers: chad, amckinley

Reviewed By: amckinley

Maniphest Tasks: T12871

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

+8 -1
+8 -1
src/applications/search/engine/PhabricatorProfileMenuEngine.php
··· 238 238 case 'view': 239 239 $navigation->selectFilter($selected_item->getDefaultMenuItemKey()); 240 240 241 - $content = $this->buildItemViewContent($selected_item); 241 + try { 242 + $content = $this->buildItemViewContent($selected_item); 243 + } catch (Exception $ex) { 244 + $content = id(new PHUIInfoView()) 245 + ->setTitle(pht('Unable to Render Dashboard')) 246 + ->setErrors(array($ex->getMessage())); 247 + } 248 + 242 249 $crumbs->addTextCrumb($selected_item->getDisplayName()); 243 250 if (!$content) { 244 251 return new Aphront404Response();