Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15430199
D17448.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
D17448.diff
View Options
diff --git a/src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php b/src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
--- a/src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
+++ b/src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
@@ -13,7 +13,6 @@
->needProfile(true)
->needProfileImage(true)
->needAvailability(true)
- ->needBadges(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -82,21 +81,17 @@
private function buildBadgesView(PhabricatorUser $user) {
$viewer = $this->getViewer();
- $awards = array();
+ $awards = id(new PhabricatorBadgesAwardQuery())
+ ->setViewer($viewer)
+ ->withRecipientPHIDs(array($user->getPHID()))
+ ->execute();
+ $awards = mpull($awards, null, 'getBadgePHID');
+
$badges = array();
- if ($user->getBadgePHIDs()) {
- $awards = id(new PhabricatorBadgesAwardQuery())
- ->setViewer($viewer)
- ->withRecipientPHIDs(array($user->getPHID()))
- ->execute();
- $awards = mpull($awards, null, 'getBadgePHID');
-
- $badges = array();
- foreach ($awards as $award) {
- $badge = $award->getBadge();
- if ($badge->getStatus() == PhabricatorBadgesBadge::STATUS_ACTIVE) {
- $badges[$award->getBadgePHID()] = $badge;
- }
+ foreach ($awards as $award) {
+ $badge = $award->getBadge();
+ if ($badge->getStatus() == PhabricatorBadgesBadge::STATUS_ACTIVE) {
+ $badges[$award->getBadgePHID()] = $badge;
}
}
diff --git a/src/applications/people/query/PhabricatorPeopleQuery.php b/src/applications/people/query/PhabricatorPeopleQuery.php
--- a/src/applications/people/query/PhabricatorPeopleQuery.php
+++ b/src/applications/people/query/PhabricatorPeopleQuery.php
@@ -23,7 +23,6 @@
private $needProfile;
private $needProfileImage;
private $needAvailability;
- private $needBadges;
private $cacheKeys = array();
public function withIDs(array $ids) {
@@ -128,11 +127,6 @@
return $this;
}
- public function needBadges($need) {
- $this->needBadges = $need;
- return $this;
- }
-
public function needUserSettings($need) {
$cache_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES;
@@ -180,21 +174,6 @@
}
}
- if ($this->needBadges) {
- $awards = id(new PhabricatorBadgesAwardQuery())
- ->setViewer($this->getViewer())
- ->withRecipientPHIDs(mpull($users, 'getPHID'))
- ->execute();
-
- $awards = mgroup($awards, 'getRecipientPHID');
-
- foreach ($users as $user) {
- $user_awards = idx($awards, $user->getPHID(), array());
- $badge_phids = mpull($user_awards, 'getBadgePHID');
- $user->attachBadgePHIDs($badge_phids);
- }
- }
-
if ($this->needAvailability) {
$rebuild = array();
foreach ($users as $user) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 25, 6:26 AM (14 h, 31 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7688296
Default Alt Text
D17448.diff (2 KB)
Attached To
Mode
D17448: Remove needBadges from PhabricatorUser
Attached
Detach File
Event Timeline
Log In to Comment