@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.

Drop test for awardable badges on "Badges" tab of user profiles to avoid overheating

Summary:
Fixes T13370. We currently show an "Award Badge" button conditionally, based on whether the viewer can award any badges or not.

The query to test this may overheat and this pattern isn't consistent with other UI anyway. Stop doing this test.

Test Plan:
- Created 12 badges.
- As a user who could not edit any of the badges, viewed the "Badges" section of a user profile.

Maniphest Tasks: T13370

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

+5 -20
+5 -20
src/applications/people/controller/PhabricatorPeopleProfileBadgesController.php
··· 34 34 $user, 35 35 PhabricatorPeopleProfileMenuEngine::ITEM_BADGES); 36 36 37 - // Best option? 38 - $badges = id(new PhabricatorBadgesQuery()) 39 - ->setViewer($viewer) 40 - ->withStatuses(array( 41 - PhabricatorBadgesBadge::STATUS_ACTIVE, 42 - )) 43 - ->requireCapabilities( 44 - array( 45 - PhabricatorPolicyCapability::CAN_VIEW, 46 - PhabricatorPolicyCapability::CAN_EDIT, 47 - )) 48 - ->setLimit(1) 49 - ->execute(); 50 - 51 37 $button = id(new PHUIButtonView()) 52 38 ->setTag('a') 53 39 ->setIcon('fa-plus') ··· 55 41 ->setWorkflow(true) 56 42 ->setHref('/badges/award/'.$user->getID().'/'); 57 43 58 - if ($badges) { 59 - $header->addActionLink($button); 60 - } 44 + $header->addActionLink($button); 61 45 62 46 $view = id(new PHUITwoColumnView()) 63 47 ->setHeader($header) 64 48 ->addClass('project-view-home') 65 49 ->addClass('project-view-people-home') 66 - ->setFooter(array( 67 - $this->buildBadgesView($user) 68 - )); 50 + ->setFooter( 51 + array( 52 + $badges, 53 + )); 69 54 70 55 return $this->newPage() 71 56 ->setTitle($title)