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(