diff --git a/src/applications/help/application/PhabricatorHelpApplication.php b/src/applications/help/application/PhabricatorHelpApplication.php index 8f0b5a52b2..c86d5cd0d0 100644 --- a/src/applications/help/application/PhabricatorHelpApplication.php +++ b/src/applications/help/application/PhabricatorHelpApplication.php @@ -79,21 +79,19 @@ final class PhabricatorHelpApplication extends PhabricatorApplication { PhabricatorUser $viewer, PhabricatorController $controller = null) { - if (!$controller) { - return null; - } - - $application = $controller->getCurrentApplication(); - if (!$application) { - return null; + $application = null; + if ($controller) { + $application = $controller->getCurrentApplication(); } $view = null; - $help_items = $application->getHelpMenuItems($viewer); - if ($help_items) { - $view = new PHUIListView(); - foreach ($help_items as $item) { - $view->addMenuItem($item); + if ($application) { + $help_items = $application->getHelpMenuItems($viewer); + if ($help_items) { + $view = new PHUIListView(); + foreach ($help_items as $item) { + $view->addMenuItem($item); + } } } diff --git a/src/view/page/menu/PhabricatorMainMenuView.php b/src/view/page/menu/PhabricatorMainMenuView.php index f49590eb8b..065674e8fd 100644 --- a/src/view/page/menu/PhabricatorMainMenuView.php +++ b/src/view/page/menu/PhabricatorMainMenuView.php @@ -72,6 +72,13 @@ final class PhabricatorMainMenuView extends AphrontView { phutil_implode_html(' ', $aural)); } + $applications = PhabricatorApplication::getAllInstalledApplications(); + foreach ($applications as $application) { + $menus[] = $application->buildMainMenuExtraNodes( + $user, + $this->getController()); + } + $application_menu = $this->renderApplicationMenu(); $classes = array(); $classes[] = 'phabricator-main-menu'; @@ -476,13 +483,6 @@ final class PhabricatorMainMenuView extends AphrontView { $message_notification_dropdown, ); - $applications = PhabricatorApplication::getAllInstalledApplications(); - foreach ($applications as $application) { - $dropdowns[] = $application->buildMainMenuExtraNodes( - $this->getUser(), - $this->getController()); - } - return array( array( $bubble_tag,