Skip to content

Commit

Permalink
Merge pull request #11082 from colemanw/CRM-20779
Browse files Browse the repository at this point in the history
CRM-20779 - Fix image display in custom field tab
  • Loading branch information
colemanw authored Oct 9, 2017
2 parents 163494a + 1470f70 commit 99a5f16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,13 @@ private static function formatDisplayValue($value, $field, $entityId = NULL) {
// In the context of displaying a profile, show file/image
if ($value) {
if ($entityId) {
$url = self::getFileURL($entityId, $field['id']);
if (CRM_Utils_Rule::positiveInteger($value)) {
$fileId = $value;
}
else {
$fileId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_File', $value, 'id', 'uri');
}
$url = self::getFileURL($entityId, $field['id'], $fileId);
if ($url) {
$display = $url['file_url'];
}
Expand Down

0 comments on commit 99a5f16

Please sign in to comment.