Page MenuHomePhorge

Fix legacy crash on Motivator backend from anonymous
Closed, ResolvedPublic

Description

Steps to reproduce. Visit this page from anonymous:

https://we.phorge.it/home/menu/new/custom/motivator/

What happens: this crash:

Undefined variable $custom_phid
phorge      applications/search/engine/PhabricatorProfileMenuEngine.php : 61        PhutilErrorHandler::handleError()
phorge      applications/search/engine/PhabricatorProfileMenuEngine.php : 916       PhabricatorProfileMenuEngine::getEditModeCustomPHID()
phorge      applications/search/engine/PhabricatorProfileMenuEngine.php : 269       PhabricatorProfileMenuEngine::buildItemNewContent()
phorge      applications/home/controller/PhabricatorHomeMenuItemController.php : 39 PhabricatorProfileMenuEngine::buildResponse()
phorge      aphront/configuration/AphrontApplicationConfiguration.php : 284 PhabricatorHomeMenuItemController::handleRequest()
phorge      aphront/configuration/AphrontApplicationConfiguration.php : 203 AphrontApplicationConfiguration::processRequest()

What should happen instead:

Probably, a login page.

Possible cause:

rPf23bfccc0467: Replace ProfileMenu bugs with different bugs

In the above change some bugs were fixed, but some bugs were introduced, as promised (lol).

Probably this is missing a default value:

https://we.phorge.it/source/phorge/browse/master/src/applications/search/engine/PhabricatorProfileMenuEngine.php;f52bc073216e9b77526561aa676b80c2c0d294de$56-58