Ref T5867. Rough in a Favorites application, not wired to anything.
I think this route is correct, but it 404s no matter what I put in, I assume then ProfileMenuRouting is 404'ing somewhere. Whats a good way to debug this?
Unhandled Exception ("Exception") Profile menu items can not be generated without an object context. Depth Library File Where 7 phabricator applications/transactions/editengine/PhabricatorEditEngine.php : 832 PhabricatorProfileMenuEditEngine::newEditableObject() 6 phabricator applications/search/engine/PhabricatorProfileMenuEngine.php : 771 PhabricatorEditEngine::buildResponse() 5 phabricator applications/search/engine/PhabricatorProfileMenuEngine.php : 151 PhabricatorProfileMenuEngine::buildItemEditContent() 4 phabricator applications/favorites/controller/PhabricatorFavoritesMenuItemController.php : 19 PhabricatorProfileMenuEngine::buildResponse() 3 phabricator aphront/configuration/AphrontApplicationConfiguration.php : 269 PhabricatorFavoritesMenuItemController::handleRequest() 2 phabricator aphront/configuration/AphrontApplicationConfiguration.php : 181 AphrontApplicationConfiguration::processRequest() 1 /var/www/html/dev/core/lib/phabricator/webroot/index.php : 17 AphrontApplicationConfiguration::runHTTPRequest()
That's valid, applications just don't have any properties.
The error you're hitting is "normal", in the sense that /edit/ doesn't do anything. Here's /edit/ in Projects:
I'll fix that to 404.
Things look better if you try /favorites/global/item/configure/.
The custom PHID stuff looks right to me.
Since you just set customPHID directly when you create the object and never change it (and it probably doesn't make sense to ever change it?) you could also get rid of all the transaction stuff, I think -- nothing will ever actually apply those transactions or interact with that code. Unless you're planning to let users reassign items to other users or something.
I think this is the best way to do it (on initialization).
You can also do it by overriding willApplyTransactions() on EditEngine and injecting new transactions when the object is created, or by adding hidden fields which generate the transactions. Both of these methods are much more complicated and don't provide any benefits in this case.