Page MenuHomePhabricator

D17219.diff
No OneTemporary

D17219.diff

diff --git a/src/applications/favorites/application/PhabricatorFavoritesApplication.php b/src/applications/favorites/application/PhabricatorFavoritesApplication.php
--- a/src/applications/favorites/application/PhabricatorFavoritesApplication.php
+++ b/src/applications/favorites/application/PhabricatorFavoritesApplication.php
@@ -36,6 +36,11 @@
PhabricatorUser $viewer,
PhabricatorController $controller = null) {
+ $dropdown = $this->renderFavoritesDropdown($viewer);
+ if (!$dropdown) {
+ return null;
+ }
+
return id(new PHUIButtonView())
->setTag('a')
->setHref('#')
@@ -43,17 +48,21 @@
->addClass('phabricator-core-user-menu')
->setNoCSS(true)
->setDropdown(true)
- ->setDropdownMenu($this->renderFavoritesDropdown($viewer));
+ ->setDropdownMenu($dropdown);
}
private function renderFavoritesDropdown(PhabricatorUser $viewer) {
-
$application = __CLASS__;
- $favorites = id(new PhabricatorApplicationQuery())
+
+ $applications = id(new PhabricatorApplicationQuery())
->setViewer($viewer)
->withClasses(array($application))
->withInstalled(true)
- ->executeOne();
+ ->execute();
+ $favorites = head($applications);
+ if (!$favorites) {
+ return null;
+ }
$menu_engine = id(new PhabricatorFavoritesProfileMenuEngine())
->setViewer($viewer)

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 9:15 AM (4 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7027585
Default Alt Text
D17219.diff (1 KB)

Event Timeline