mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-15 10:00:55 +01:00
(stable) Fix an error in Diffusion when the Owners application is uninstalled
Summary: See <https://discourse.phabricator-community.org/t/undefined-view-when-owners-is-uninstalled/451>. When Owners is not installed, Diffusion can fatal with a bad `$view`. Test Plan: - Uninstall Owners. - View the content of any file in Diffusion. - Before: fatal on `$view` undefined. - After: Valid page with no owners information. Reviewers: amckinley Reviewed By: amckinley Differential Revision: https://secure.phabricator.com/D18629
This commit is contained in:
parent
3f3ce88c7b
commit
52fff638ca
1 changed files with 60 additions and 56 deletions
|
@ -799,12 +799,17 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
}
|
||||
|
||||
private function buildOwnersList(DiffusionRequest $drequest) {
|
||||
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$have_owners = PhabricatorApplication::isClassInstalledForViewer(
|
||||
'PhabricatorOwnersApplication',
|
||||
$viewer);
|
||||
if (!$have_owners) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
$owners = 'PhabricatorOwnersApplication';
|
||||
if (PhabricatorApplication::isClassInstalled($owners)) {
|
||||
$package_query = id(new PhabricatorOwnersPackageQuery())
|
||||
->setViewer($viewer)
|
||||
->withStatuses(array(PhabricatorOwnersPackage::STATUS_ACTIVE))
|
||||
|
@ -866,7 +871,6 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addClass('diffusion-mobile-view')
|
||||
->setObjectList($ownership);
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue