Skip to content

Commit 7ec42db

Browse files
brechtvlepriestley
authored andcommitted
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
1 parent 71adee7 commit 7ec42db

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/applications/diffusion/controller/DiffusionBrowseController.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,21 @@ protected function buildActionView(DiffusionRequest $drequest) {
104104
// TODO: Ideally, this should live in Owners and be event-triggered, but
105105
// there's no reasonable object for it to react to right now.
106106

107-
$owners_uri = id(new PhutilURI('/owners/view/search/'))
108-
->setQueryParams(
109-
array(
110-
'repository' => $drequest->getCallsign(),
111-
'path' => '/'.$drequest->getPath(),
112-
));
113-
114-
$view->addAction(
115-
id(new PhabricatorActionView())
116-
->setName(pht('Find Owners'))
117-
->setHref((string)$owners_uri)
118-
->setIcon('preview'));
107+
$owners = 'PhabricatorApplicationOwners';
108+
if (PhabricatorApplication::isClassInstalled($owners)) {
109+
$owners_uri = id(new PhutilURI('/owners/view/search/'))
110+
->setQueryParams(
111+
array(
112+
'repository' => $drequest->getCallsign(),
113+
'path' => '/'.$drequest->getPath(),
114+
));
115+
116+
$view->addAction(
117+
id(new PhabricatorActionView())
118+
->setName(pht('Find Owners'))
119+
->setHref((string)$owners_uri)
120+
->setIcon('preview'));
121+
}
119122

120123
return $view;
121124
}

0 commit comments

Comments
 (0)