Skip to content

Commit

Permalink
Merge pull request civicrm#15055 from demeritcowboy/file-no-description
Browse files Browse the repository at this point in the history
dev/core#1186 - ignore exception if no description field
  • Loading branch information
eileenmcnaughton authored Aug 17, 2019
2 parents 40a5085 + 419b013 commit e251108
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CRM/Core/BAO/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,16 @@ private static function formatDisplayValue($value, $field, $entityId = NULL) {
// In other contexts show a paperclip icon
if (CRM_Utils_Rule::integer($value)) {
$icons = CRM_Core_BAO_File::paperIconAttachment('*', $value);
$display = $icons[$value] . civicrm_api3('File', 'getvalue', ['return' => "description", 'id' => $value]);

$file_description = '';
try {
$file_description = civicrm_api3('File', 'getvalue', ['return' => "description", 'id' => $value]);
}
catch (CiviCRM_API3_Exception $dontcare) {
// don't care
}

$display = "{$icons[$value]}{$file_description}";
}
else {
//CRM-18396, if filename is passed instead
Expand Down

0 comments on commit e251108

Please sign in to comment.