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

People - fix hovercards for people

Summary: Fixes T8242. D12833 removed the title as well as the blurb from people hovercards. When re-adding the title don't bother throwing things through pht since that seems like not something you translate exactly and also lose the flavor text which most users end up having since title is rarely set (at least on this install).

Test Plan: viewed hovercards and saw title and blurb again as appropos relative to the data being set

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8242

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

+18 -1
+14 -1
src/applications/people/event/PhabricatorPeopleHovercardEventListener.php
··· 31 31 ->setViewer($viewer) 32 32 ->withIDs(array($user->getID())) 33 33 ->needAvailability(true) 34 + ->needProfile(true) 34 35 ->executeOne(); 35 36 36 37 $hovercard->setTitle($user->getUsername()); 37 - $hovercard->setDetail($user->getRealName()); 38 + $profile = $user->getUserProfile(); 39 + $detail = $user->getRealName(); 40 + if ($profile->getTitle()) { 41 + $detail .= ' - '.$profile->getTitle().'.'; 42 + } 43 + $hovercard->setDetail($detail); 38 44 39 45 if ($user->getIsDisabled()) { 40 46 $hovercard->addField(pht('Account'), pht('Disabled')); ··· 51 57 $hovercard->addField( 52 58 pht('User Since'), 53 59 phabricator_date($user->getDateCreated(), $viewer)); 60 + 61 + if ($profile->getBlurb()) { 62 + $hovercard->addField(pht('Blurb'), 63 + id(new PhutilUTF8StringTruncator()) 64 + ->setMaximumGlyphs(120) 65 + ->truncateString($profile->getBlurb())); 66 + } 54 67 55 68 $event->setValue('hovercard', $hovercard); 56 69 }
+4
src/applications/people/storage/PhabricatorUser.php
··· 396 396 return substr(PhabricatorHash::digest($vec), 0, $len); 397 397 } 398 398 399 + public function getUserProfile() { 400 + return $this->assertAttached($this->profile); 401 + } 402 + 399 403 public function attachUserProfile(PhabricatorUserProfile $profile) { 400 404 $this->profile = $profile; 401 405 return $this;