1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Make profile menu /edit/ requests explicitly 404

Summary:
See D17160. Previously, the `/edit/` route was never linked, but fataled when accessed. Make it 404 instead.

Also, fix an issue where editing "Application" menu items would fail because they didn't have a viewer.

Test Plan:
  - Hit `/edit/`, got a 404.
  - Edited an "Application" item.
  - Moved, added, deleted, and edited other items.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D17165
This commit is contained in:
epriestley 2017-01-09 11:57:32 -08:00
parent 2dfe79cfc7
commit 0e1388340c
2 changed files with 11 additions and 0 deletions

View file

@ -114,6 +114,16 @@ abstract class PhabricatorProfileMenuEngine extends Phobject {
return new Aphront404Response();
}
break;
case 'edit':
if (!$request->getURIData('id')) {
// If we continue along the "edit" pathway without an ID, we hit an
// unrelated exception because we can not build a new menu item out
// of thin air. For menus, new items are created via the "new"
// action. Just catch this case and 404 early since there's currently
// no clean way to make EditEngine aware of this.
return new Aphront404Response();
}
break;
}
$navigation = $this->buildNavigation();

View file

@ -80,6 +80,7 @@ final class PhabricatorProfileMenuItemConfigurationQuery
continue;
}
$item_type = clone $item_type;
$item_type->setViewer($this->getViewer());
$item->attachMenuItem($item_type);
}