From 8825a09f676aaf316fe97d38eb2db41edfa91e2e Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Wed, 26 Jun 2024 23:00:08 +0200 Subject: [PATCH] Fix legacy crash when visiting Motivator backend as anon Summary: Now anonymous people can visit this page: http://phorge.localhost/home/menu/new/custom/motivator/ And you do not see anymore 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() Closes T15867 Test Plan: Visit the mentioned page as logged-in. It still works. Visit the mentioned page as logged-out. No crash anymore. You are redirected to the login page. Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15867 Differential Revision: https://we.phorge.it/D25700 --- src/applications/search/engine/PhabricatorProfileMenuEngine.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/search/engine/PhabricatorProfileMenuEngine.php b/src/applications/search/engine/PhabricatorProfileMenuEngine.php index bfa3d11ee5..89cb6cb40a 100644 --- a/src/applications/search/engine/PhabricatorProfileMenuEngine.php +++ b/src/applications/search/engine/PhabricatorProfileMenuEngine.php @@ -54,6 +54,7 @@ abstract class PhabricatorProfileMenuEngine extends Phobject { $custom_phid = $this->getCustomPHID(); break; case self::MODE_GLOBAL: + default: $custom_phid = null; break; } -- 2.51.2