Page MenuHomePhabricator

Allow "Manage" to be the default menu item for projects
ClosedPublic

Authored by epriestley on Dec 23 2017, 4:44 PM.
Tags
None
Referenced Files
F13087833: D18843.diff
Thu, Apr 25, 1:07 AM
Unknown Object (File)
Sun, Apr 21, 9:16 PM
Unknown Object (File)
Fri, Apr 19, 6:38 AM
Unknown Object (File)
Fri, Apr 19, 2:44 AM
Unknown Object (File)
Mon, Apr 15, 5:29 PM
Unknown Object (File)
Sun, Apr 14, 5:15 PM
Unknown Object (File)
Sun, Apr 14, 2:06 PM
Unknown Object (File)
Thu, Apr 11, 11:55 PM
Subscribers

Details

Summary

Fixes T13033. Currently (prior to D18836) all the default items for projects can be hidden. When this occurs, the main project page fatals.

If we fix the fatal narrowly (don't try to call null->getBuiltinKey() when $default is null), it would 404, which is a little better but not by much.

After D18836 you can't hide "Profile", which is pretty sensible, and effectively fixes this. This change doubles down: let "Manage" be a default, and send the user there if we can't find a different default.

Ideally, the MenuEngine itself will do more rendering eventually (as it does for some of the newer Home stuff) and could handle this defaulting behavior with less special casing, but we'd still end up in a similar situation if a project had only one "Link" item to "coolcats.com" or something: redirecting the user to "coolcats.com" is probably better than fataling, but not by a huge margin, and not likely to be what they expect.

Test Plan

Before D18836, disabled both "Profile" and "Workboard" items on a project. Visited project page.

Before patch: fatal. After patch: manage page.

After D18836, you can't do this and just get the profile, so this is sort of moot and mostly future-proofing/for-completeness.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Dec 23 2017, 7:21 PM
This revision was automatically updated to reflect the committed changes.
zonr added inline comments.
src/applications/project/controller/PhabricatorProjectViewController.php
31

Should this be switch ($default_key)?