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

Make Project Mobile menu more resilient

Summary: This sets $project at the controller level so it's available to building the icon nav and mobile menu, instead of guessing the $id. Fixes T7289

Test Plan: Test a project and its mobile menu when it does and does not have a workboard initialized. Also tested coming in via a slug and an id.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

Subscribers: Korvin, epriestley

Maniphest Tasks: T7289

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

+17 -14
-10
src/applications/project/controller/PhabricatorProjectBoardController.php
··· 3 3 abstract class PhabricatorProjectBoardController 4 4 extends PhabricatorProjectController { 5 5 6 - private $project; 7 - 8 - protected function setProject(PhabricatorProject $project) { 9 - $this->project = $project; 10 - return $this; 11 - } 12 - protected function getProject() { 13 - return $this->project; 14 - } 15 - 16 6 public function buildIconNavView(PhabricatorProject $project) { 17 7 $id = $project->getID(); 18 8 $nav = parent::buildIconNavView($project);
+17 -4
src/applications/project/controller/PhabricatorProjectController.php
··· 2 2 3 3 abstract class PhabricatorProjectController extends PhabricatorController { 4 4 5 + private $project; 6 + 7 + protected function setProject(PhabricatorProject $project) { 8 + $this->project = $project; 9 + return $this; 10 + } 11 + 12 + protected function getProject() { 13 + return $this->project; 14 + } 15 + 5 16 public function buildApplicationMenu() { 6 17 return $this->buildSideNavView(true)->getMenu(); 7 18 } 8 19 9 20 public function buildSideNavView($for_app = false) { 10 - $viewer = $this->getViewer(); 21 + $project = $this->getProject(); 11 22 12 23 $nav = new AphrontSideNavFilterView(); 13 24 $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 14 25 15 - $id = null; 26 + $viewer = $this->getViewer(); 27 + 16 28 if ($for_app) { 17 - $id = $this->getRequest()->getURIData('id'); 18 - if ($id) { 29 + if ($project) { 30 + $id = $project->getID(); 19 31 $nav->addFilter("profile/{$id}/", pht('Profile')); 20 32 $nav->addFilter("board/{$id}/", pht('Workboard')); 21 33 $nav->addFilter("members/{$id}/", pht('Members')); ··· 37 49 } 38 50 39 51 public function buildIconNavView(PhabricatorProject $project) { 52 + $this->setProject($project); 40 53 $viewer = $this->getViewer(); 41 54 $id = $project->getID(); 42 55 $picture = $project->getProfileImageURI();