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

Project Hovercards: Show Description

Summary: Fixes T15275.

Test Plan:
Project pages have "Developer > View Hovercard" button. Or hover over a project handle, I guess.

Also test for empty description and with the description field disabled.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15275

Differential Revision: https://we.phorge.it/D25331

+42
+20
src/applications/project/engineextension/PhabricatorProjectHovercardEngineExtension.php
··· 28 28 ->execute(); 29 29 $projects = mpull($projects, null, 'getPHID'); 30 30 31 + $custom_fields = array(); 32 + foreach ($projects as $project) { 33 + $field = PhabricatorCustomField::getObjectField( 34 + $project, 35 + PhabricatorCustomField::ROLE_VIEW, 36 + 'std:project:internal:description'); 37 + if ($field === null) { 38 + // This means the field is disabled, it would always be null. 39 + break; 40 + } 41 + $field 42 + ->setViewer($viewer) 43 + ->readValueFromObject($project); 44 + $custom_fields[] = $field; 45 + } 46 + 47 + id(new PhabricatorCustomFieldStorageQuery()) 48 + ->addFields($custom_fields) 49 + ->execute(); 50 + 31 51 return array( 32 52 'projects' => $projects, 33 53 );
+22
src/applications/project/view/PhabricatorProjectCardView.php
··· 68 68 69 69 $description = null; 70 70 71 + // This getProxy() feels hacky - see also PhabricatorProjectDatasource:67 72 + $description_field = PhabricatorCustomField::getObjectField( 73 + $project, 74 + PhabricatorCustomField::ROLE_VIEW, 75 + 'std:project:internal:description'); 76 + 77 + if ($description_field !== null) { 78 + $description_field = $description_field->getProxy(); 79 + 80 + $description = $description_field->getFieldValue(); 81 + if (phutil_nonempty_string($description)) { 82 + $description = PhabricatorMarkupEngine::summarizeSentence($description); 83 + $description = id(new PHUIRemarkupView($viewer, $description)) 84 + ->setContextObject($project); 85 + 86 + $description = phutil_tag( 87 + 'div', 88 + array('class' => 'project-card-body phui-header-shell'), 89 + $description); 90 + } 91 + } 92 + 71 93 $card = phutil_tag( 72 94 'div', 73 95 array(