@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.

Fix a couple of home menu issues for logged-out viewers

Summary: Ref T12174. These items could fatal (`$item not defined`) if the viewer was not logged in.

Test Plan: - Viewed home as a logged-out user.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12174

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

+19 -25
+1 -7
src/applications/home/controller/PhabricatorHomeMenuItemController.php
··· 14 14 public function handleRequest(AphrontRequest $request) { 15 15 $viewer = $this->getViewer(); 16 16 17 - if ($viewer->getPHID()) { 18 - $custom_phid = $viewer->getPHID(); 19 - } else { 20 - $custom_phid = null; 21 - } 22 - 23 17 $application = 'PhabricatorHomeApplication'; 24 18 $home_app = id(new PhabricatorApplicationQuery()) 25 19 ->setViewer($viewer) ··· 29 23 30 24 $engine = id(new PhabricatorHomeProfileMenuEngine()) 31 25 ->setProfileObject($home_app) 32 - ->setCustomPHID($custom_phid) 26 + ->setCustomPHID($viewer->getPHID()) 33 27 ->setController($this); 34 28 35 29 return $engine->buildResponse();
+7 -9
src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
··· 49 49 PhabricatorProfileMenuItemConfiguration $config) { 50 50 $viewer = $this->getViewer(); 51 51 52 - if ($viewer->isLoggedIn()) { 53 - $name = $this->getDisplayName($config); 54 - $icon = 'fa-globe'; 55 - $href = '/applications/'; 52 + $name = $this->getDisplayName($config); 53 + $icon = 'fa-globe'; 54 + $href = '/applications/'; 56 55 57 - $item = $this->newItem() 58 - ->setHref($href) 59 - ->setName($name) 60 - ->setIcon($icon); 61 - } 56 + $item = $this->newItem() 57 + ->setHref($href) 58 + ->setName($name) 59 + ->setIcon($icon); 62 60 63 61 return array( 64 62 $item,
+11 -9
src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
··· 56 56 PhabricatorProfileMenuItemConfiguration $config) { 57 57 $viewer = $this->getViewer(); 58 58 59 - if ($viewer->isLoggedIn()) { 60 - $name = $this->getDisplayName($config); 61 - $icon = 'fa-home'; 62 - $href = $this->getItemViewURI($config); 63 - 64 - $item = $this->newItem() 65 - ->setHref($href) 66 - ->setName($name) 67 - ->setIcon($icon); 59 + if (!$viewer->isLoggedIn()) { 60 + return array(); 68 61 } 62 + 63 + $name = $this->getDisplayName($config); 64 + $icon = 'fa-home'; 65 + $href = $this->getItemViewURI($config); 66 + 67 + $item = $this->newItem() 68 + ->setHref($href) 69 + ->setName($name) 70 + ->setIcon($icon); 69 71 70 72 return array( 71 73 $item,