Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15414174
D15182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15182.diff
View Options
diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php
@@ -176,39 +176,40 @@
return $box;
}
- private function buildBadgesView(
- PhabricatorUser $user) {
+ private function buildBadgesView(PhabricatorUser $user) {
$viewer = $this->getViewer();
$class = 'PhabricatorBadgesApplication';
- if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
- $badge_phids = $user->getBadgePHIDs();
- if ($badge_phids) {
- $badges = id(new PhabricatorBadgesQuery())
- ->setViewer($viewer)
- ->withPHIDs($badge_phids)
- ->withStatuses(array(PhabricatorBadgesBadge::STATUS_ACTIVE))
- ->execute();
-
- $flex = new PHUIBadgeBoxView();
- foreach ($badges as $badge) {
- $item = id(new PHUIBadgeView())
- ->setIcon($badge->getIcon())
- ->setHeader($badge->getName())
- ->setSubhead($badge->getFlavor())
- ->setQuality($badge->getQuality());
- $flex->addItem($item);
- }
-
- } else {
- $error = id(new PHUIBoxView())
- ->addClass('mlb')
- ->appendChild(pht('User does not have any badges.'));
- $flex = id(new PHUIInfoView())
- ->setSeverity(PHUIInfoView::SEVERITY_NODATA)
- ->appendChild($error);
+ if (!PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
+ return null;
+ }
+
+ $badge_phids = $user->getBadgePHIDs();
+ if ($badge_phids) {
+ $badges = id(new PhabricatorBadgesQuery())
+ ->setViewer($viewer)
+ ->withPHIDs($badge_phids)
+ ->withStatuses(array(PhabricatorBadgesBadge::STATUS_ACTIVE))
+ ->execute();
+
+ $flex = new PHUIBadgeBoxView();
+ foreach ($badges as $badge) {
+ $item = id(new PHUIBadgeView())
+ ->setIcon($badge->getIcon())
+ ->setHeader($badge->getName())
+ ->setSubhead($badge->getFlavor())
+ ->setQuality($badge->getQuality());
+ $flex->addItem($item);
}
+
+ } else {
+ $error = id(new PHUIBoxView())
+ ->addClass('mlb')
+ ->appendChild(pht('User does not have any badges.'));
+ $flex = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_NODATA)
+ ->appendChild($error);
}
$box = id(new PHUIObjectBoxView())
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 11:17 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7384172
Default Alt Text
D15182.diff (2 KB)
Attached To
Mode
D15182: Fix bad rendering pathway on user profiles for viewers without Badges application
Attached
Detach File
Event Timeline
Log In to Comment