From: Coleman Watts Date: Fri, 13 Mar 2015 01:57:53 +0000 (-0400) Subject: CRM-16076 - Restore file/image behavior in profiles X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5f7e0d20dbd6852a72b40e24ca0ff50aa68bd319;p=civicrm-core.git CRM-16076 - Restore file/image behavior in profiles --- diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 5ea64fb31c..d46ffb0139 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1286,7 +1286,15 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { break; case 'File': - if ($value) { + // In the context of displaying a profile, show file/image + if ($contactID) { + $url = self::getFileURL($contactID, $fieldID, $value); + if ($url) { + $display = $url['file_url']; + } + } + // In other contexts show a paperclip icon + elseif ($value) { $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value); $display = $icons[$value]; }