@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Always render extra menu nodes, even when logged out

Summary:
Fixes T7915. This code is a little janky, but make it work for now.

Currently, we render "extra" nodes (dropdowns, etc) only if the user is logged in.

Instead, always render them.

Test Plan:
- No more "phabricator-help-menu" error in console when logged out.
- Search selector now works when logged out.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7915

Differential Revision: https://secure.phabricator.com/D12572

+17 -19
+10 -12
src/applications/help/application/PhabricatorHelpApplication.php
··· 79 79 PhabricatorUser $viewer, 80 80 PhabricatorController $controller = null) { 81 81 82 - if (!$controller) { 83 - return null; 84 - } 85 - 86 - $application = $controller->getCurrentApplication(); 87 - if (!$application) { 88 - return null; 82 + $application = null; 83 + if ($controller) { 84 + $application = $controller->getCurrentApplication(); 89 85 } 90 86 91 87 $view = null; 92 - $help_items = $application->getHelpMenuItems($viewer); 93 - if ($help_items) { 94 - $view = new PHUIListView(); 95 - foreach ($help_items as $item) { 96 - $view->addMenuItem($item); 88 + if ($application) { 89 + $help_items = $application->getHelpMenuItems($viewer); 90 + if ($help_items) { 91 + $view = new PHUIListView(); 92 + foreach ($help_items as $item) { 93 + $view->addMenuItem($item); 94 + } 97 95 } 98 96 } 99 97
+7 -7
src/view/page/menu/PhabricatorMainMenuView.php
··· 72 72 phutil_implode_html(' ', $aural)); 73 73 } 74 74 75 + $applications = PhabricatorApplication::getAllInstalledApplications(); 76 + foreach ($applications as $application) { 77 + $menus[] = $application->buildMainMenuExtraNodes( 78 + $user, 79 + $this->getController()); 80 + } 81 + 75 82 $application_menu = $this->renderApplicationMenu(); 76 83 $classes = array(); 77 84 $classes[] = 'phabricator-main-menu'; ··· 475 482 $notification_dropdown, 476 483 $message_notification_dropdown, 477 484 ); 478 - 479 - $applications = PhabricatorApplication::getAllInstalledApplications(); 480 - foreach ($applications as $application) { 481 - $dropdowns[] = $application->buildMainMenuExtraNodes( 482 - $this->getUser(), 483 - $this->getController()); 484 - } 485 485 486 486 return array( 487 487 array(