@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove needBadges from PhabricatorUser

Summary: Ref T12270. We don't really need these, timeline does it's own thing, badges is now a profile page, and hovercards have been removed.

Test Plan: Visit timeline, still see badges, visit my profile page, bask in the warmth of fake awards.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12270

Differential Revision: https://secure.phabricator.com/D17448

+10 -36
+10 -15
src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
··· 13 13 ->needProfile(true) 14 14 ->needProfileImage(true) 15 15 ->needAvailability(true) 16 - ->needBadges(true) 17 16 ->requireCapabilities( 18 17 array( 19 18 PhabricatorPolicyCapability::CAN_VIEW, ··· 82 81 private function buildBadgesView(PhabricatorUser $user) { 83 82 $viewer = $this->getViewer(); 84 83 85 - $awards = array(); 86 - $badges = array(); 87 - if ($user->getBadgePHIDs()) { 88 - $awards = id(new PhabricatorBadgesAwardQuery()) 89 - ->setViewer($viewer) 90 - ->withRecipientPHIDs(array($user->getPHID())) 91 - ->execute(); 92 - $awards = mpull($awards, null, 'getBadgePHID'); 84 + $awards = id(new PhabricatorBadgesAwardQuery()) 85 + ->setViewer($viewer) 86 + ->withRecipientPHIDs(array($user->getPHID())) 87 + ->execute(); 88 + $awards = mpull($awards, null, 'getBadgePHID'); 93 89 94 - $badges = array(); 95 - foreach ($awards as $award) { 96 - $badge = $award->getBadge(); 97 - if ($badge->getStatus() == PhabricatorBadgesBadge::STATUS_ACTIVE) { 98 - $badges[$award->getBadgePHID()] = $badge; 99 - } 90 + $badges = array(); 91 + foreach ($awards as $award) { 92 + $badge = $award->getBadge(); 93 + if ($badge->getStatus() == PhabricatorBadgesBadge::STATUS_ACTIVE) { 94 + $badges[$award->getBadgePHID()] = $badge; 100 95 } 101 96 } 102 97
-21
src/applications/people/query/PhabricatorPeopleQuery.php
··· 23 23 private $needProfile; 24 24 private $needProfileImage; 25 25 private $needAvailability; 26 - private $needBadges; 27 26 private $cacheKeys = array(); 28 27 29 28 public function withIDs(array $ids) { ··· 128 127 return $this; 129 128 } 130 129 131 - public function needBadges($need) { 132 - $this->needBadges = $need; 133 - return $this; 134 - } 135 - 136 130 public function needUserSettings($need) { 137 131 $cache_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES; 138 132 ··· 177 171 } 178 172 179 173 $user->attachUserProfile($profile); 180 - } 181 - } 182 - 183 - if ($this->needBadges) { 184 - $awards = id(new PhabricatorBadgesAwardQuery()) 185 - ->setViewer($this->getViewer()) 186 - ->withRecipientPHIDs(mpull($users, 'getPHID')) 187 - ->execute(); 188 - 189 - $awards = mgroup($awards, 'getRecipientPHID'); 190 - 191 - foreach ($users as $user) { 192 - $user_awards = idx($awards, $user->getPHID(), array()); 193 - $badge_phids = mpull($user_awards, 'getBadgePHID'); 194 - $user->attachBadgePHIDs($badge_phids); 195 174 } 196 175 } 197 176