1
0
Fork 0
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:
lkassianik 2016-04-02 18:51:23 -07:00
parent 219357aa9f
commit e66bf17505

View file

@ -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)) {