1
0
Fork 0
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:
Brecht Van Lommel 2013-11-11 09:12:08 -08:00 committed by epriestley
parent 71adee75b0
commit 7ec42dbbea

View file

@ -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;
} }