mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Fix 404 clicking Find Owners in diffusion, if Owners application is disabled.
Test Plan: Install/uninstall Owners application, Find Owners action shown/hidden as expected. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: Korvin, epriestley, aran Differential Revision: https://secure.phabricator.com/D7557
This commit is contained in:
parent
71adee75b0
commit
7ec42dbbea
1 changed files with 14 additions and 11 deletions
|
@ -104,18 +104,21 @@ abstract class DiffusionBrowseController extends DiffusionController {
|
||||||
// TODO: Ideally, this should live in Owners and be event-triggered, but
|
// TODO: Ideally, this should live in Owners and be event-triggered, but
|
||||||
// there's no reasonable object for it to react to right now.
|
// there's no reasonable object for it to react to right now.
|
||||||
|
|
||||||
$owners_uri = id(new PhutilURI('/owners/view/search/'))
|
$owners = 'PhabricatorApplicationOwners';
|
||||||
->setQueryParams(
|
if (PhabricatorApplication::isClassInstalled($owners)) {
|
||||||
array(
|
$owners_uri = id(new PhutilURI('/owners/view/search/'))
|
||||||
'repository' => $drequest->getCallsign(),
|
->setQueryParams(
|
||||||
'path' => '/'.$drequest->getPath(),
|
array(
|
||||||
));
|
'repository' => $drequest->getCallsign(),
|
||||||
|
'path' => '/'.$drequest->getPath(),
|
||||||
|
));
|
||||||
|
|
||||||
$view->addAction(
|
$view->addAction(
|
||||||
id(new PhabricatorActionView())
|
id(new PhabricatorActionView())
|
||||||
->setName(pht('Find Owners'))
|
->setName(pht('Find Owners'))
|
||||||
->setHref((string)$owners_uri)
|
->setHref((string)$owners_uri)
|
||||||
->setIcon('preview'));
|
->setIcon('preview'));
|
||||||
|
}
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue