Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2682292
D25331.1734652902.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
D25331.1734652902.diff
View Options
diff --git a/src/applications/project/engineextension/PhabricatorProjectHovercardEngineExtension.php b/src/applications/project/engineextension/PhabricatorProjectHovercardEngineExtension.php
--- a/src/applications/project/engineextension/PhabricatorProjectHovercardEngineExtension.php
+++ b/src/applications/project/engineextension/PhabricatorProjectHovercardEngineExtension.php
@@ -28,6 +28,26 @@
->execute();
$projects = mpull($projects, null, 'getPHID');
+ $custom_fields = array();
+ foreach ($projects as $project) {
+ $field = PhabricatorCustomField::getObjectField(
+ $project,
+ PhabricatorCustomField::ROLE_VIEW,
+ 'std:project:internal:description');
+ if ($field === null) {
+ // This means the field is disabled, it would always be null.
+ break;
+ }
+ $field
+ ->setViewer($viewer)
+ ->readValueFromObject($project);
+ $custom_fields[] = $field;
+ }
+
+ id(new PhabricatorCustomFieldStorageQuery())
+ ->addFields($custom_fields)
+ ->execute();
+
return array(
'projects' => $projects,
);
diff --git a/src/applications/project/view/PhabricatorProjectCardView.php b/src/applications/project/view/PhabricatorProjectCardView.php
--- a/src/applications/project/view/PhabricatorProjectCardView.php
+++ b/src/applications/project/view/PhabricatorProjectCardView.php
@@ -68,6 +68,28 @@
$description = null;
+ // This getProxy() feels hacky - see also PhabricatorProjectDatasource:67
+ $description_field = PhabricatorCustomField::getObjectField(
+ $project,
+ PhabricatorCustomField::ROLE_VIEW,
+ 'std:project:internal:description');
+
+ if ($description_field !== null) {
+ $description_field = $description_field->getProxy();
+
+ $description = $description_field->getFieldValue();
+ if (phutil_nonempty_string($description)) {
+ $description = PhabricatorMarkupEngine::summarizeSentence($description);
+ $description = id(new PHUIRemarkupView($viewer, $description))
+ ->setContextObject($project);
+
+ $description = phutil_tag(
+ 'div',
+ array('class' => 'project-card-body phui-header-shell'),
+ $description);
+ }
+ }
+
$card = phutil_tag(
'div',
array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 00:01 (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016251
Default Alt Text
D25331.1734652902.diff (2 KB)
Attached To
Mode
D25331: Project Hovercards: Show Description
Attached
Detach File
Event Timeline
Log In to Comment