mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
Fixing the badges query, yet again
Summary: Forgot a more efficient way to get badge from award Test Plan: Badges on user profiles should still show up with awarder handle on the back of the card Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D15589
This commit is contained in:
parent
219357aa9f
commit
e66bf17505
1 changed files with 7 additions and 7 deletions
|
@ -190,13 +190,13 @@ final class PhabricatorPeopleProfileViewController
|
|||
->execute();
|
||||
$awards = mpull($awards, null, 'getBadgePHID');
|
||||
|
||||
$badge_phids = mpull($awards, 'getBadgePHID');
|
||||
$badges = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs($badge_phids)
|
||||
->withStatuses(array(PhabricatorBadgesBadge::STATUS_ACTIVE))
|
||||
->execute();
|
||||
$badges = mpull($badges, null, 'getPHID');
|
||||
$badges = array();
|
||||
foreach ($awards as $award) {
|
||||
$badge = $award->getBadge();
|
||||
if ($badge->getStatus() == PhabricatorBadgesBadge::STATUS_ACTIVE) {
|
||||
$badges[$award->getBadgePHID()] = $badge;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($badges)) {
|
||||
|
|
Loading…
Reference in a new issue