Page MenuHomePhorge

D25331.1734652902.diff
No OneTemporary

D25331.1734652902.diff

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

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)

Event Timeline