mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +01:00
Fix bad rendering pathway on user profiles for viewers without Badges application
Summary: Fixes T10275. We'd fatal on `$flex` not being defined. Test Plan: Uninstalled badges, viewed profile. Before: fatal; now: no badges element appears but profile renders properly. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10275 Differential Revision: https://secure.phabricator.com/D15182
This commit is contained in:
parent
2f0571923c
commit
42954bc5ac
1 changed files with 27 additions and 26 deletions
|
@ -176,13 +176,15 @@ final class PhabricatorPeopleProfileViewController
|
||||||
return $box;
|
return $box;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildBadgesView(
|
private function buildBadgesView(PhabricatorUser $user) {
|
||||||
PhabricatorUser $user) {
|
|
||||||
|
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
$class = 'PhabricatorBadgesApplication';
|
$class = 'PhabricatorBadgesApplication';
|
||||||
|
|
||||||
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
if (!PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$badge_phids = $user->getBadgePHIDs();
|
$badge_phids = $user->getBadgePHIDs();
|
||||||
if ($badge_phids) {
|
if ($badge_phids) {
|
||||||
$badges = id(new PhabricatorBadgesQuery())
|
$badges = id(new PhabricatorBadgesQuery())
|
||||||
|
@ -209,7 +211,6 @@ final class PhabricatorPeopleProfileViewController
|
||||||
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
|
->setSeverity(PHUIInfoView::SEVERITY_NODATA)
|
||||||
->appendChild($error);
|
->appendChild($error);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$box = id(new PHUIObjectBoxView())
|
$box = id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Badges'))
|
->setHeaderText(pht('Badges'))
|
||||||
|
|
Loading…
Reference in a new issue