From d8f34a6e5245eab54c4befd4ca844eb05b888d35 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 2 Feb 2015 15:35:35 -0500 Subject: [PATCH] CRM-13624 - Fix api regression - format link in display layer instead of data layer --- CRM/Core/BAO/CustomField.php | 8 +++----- CRM/Core/BAO/CustomValueTable.php | 20 ++------------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index da6671bb40..5ea64fb31c 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1286,11 +1286,9 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { break; case 'File': - if ($contactID) { - $url = self::getFileURL($contactID, $fieldID, $value); - if ($url) { - $display = $url['file_url']; - } + if ($value) { + $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value); + $display = $icons[$value]; } break; diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 2cb38118fd..365495d54e 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -453,29 +453,13 @@ AND $cond $fieldName = "custom_{$fieldID}"; if ($isMultiple[$tableName]) { if ($formatMultiRecordField) { - if($file[$tableName][$fieldID] == 'File') { - if($fileid = $dao->$fieldName) { - $fileurl = CRM_Core_BAO_File::paperIconAttachment($tableName,$entityID); - $result["{$dao->id}"]["{$fieldID}"] = $fileurl[$dao->$fieldName]; - } - } - else { - $result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName; - } + $result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName; } else { $result["{$fieldID}_{$dao->id}"] = $dao->$fieldName; } } else { - if($file[$tableName][$fieldID] == 'File') { - if($fileid = $dao->$fieldName) { - $fileurl = CRM_Core_BAO_File::paperIconAttachment($tableName,$entityID); - $result[$fieldID] = $fileurl[$dao->$fieldName]; - } - } - else { - $result[$fieldID] = $dao->$fieldName; - } + $result[$fieldID] = $dao->$fieldName; } } } -- 2.25.1