Page MenuHomePhabricator

D11684.diff
No OneTemporary

D11684.diff

diff --git a/src/applications/home/application/PhabricatorHomeApplication.php b/src/applications/home/application/PhabricatorHomeApplication.php
--- a/src/applications/home/application/PhabricatorHomeApplication.php
+++ b/src/applications/home/application/PhabricatorHomeApplication.php
@@ -46,9 +46,12 @@
PhabricatorUser $user,
PhabricatorController $controller = null) {
+ $quick_create_items = $this->loadAllQuickCreateItems($user);
$items = array();
- if ($user->isLoggedIn() && $user->isUserActivated()) {
+ if ($user->isLoggedIn() &&
+ $user->isUserActivated() &&
+ $quick_create_items) {
$create_id = celerity_generate_unique_node_id();
Javelin::initBehavior(
'aphlict-dropdown',
@@ -98,20 +101,24 @@
$items = $this->loadAllQuickCreateItems($viewer);
- $view = new PHUIListView();
- $view->newLabel(pht('Create New...'));
- foreach ($items as $item) {
- $view->addMenuItem($item);
- }
+ $view = null;
+ if ($items) {
+ $view = new PHUIListView();
+ $view->newLabel(pht('Create New...'));
+ foreach ($items as $item) {
+ $view->addMenuItem($item);
+ }
- return phutil_tag(
- 'div',
- array(
- 'id' => 'phabricator-quick-create-menu',
- 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav',
- 'style' => 'display: none',
- ),
- $view);
+ return phutil_tag(
+ 'div',
+ array(
+ 'id' => 'phabricator-quick-create-menu',
+ 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav',
+ 'style' => 'display: none',
+ ),
+ $view);
+ }
+ return $view;
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 2, 8:39 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6742215
Default Alt Text
D11684.diff (1 KB)

Event Timeline