Skip to content
Snippets Groups Projects
Commit cd447195 authored by yashodha's avatar yashodha
Browse files

(#1787) Regression : File fields export results in DB error

parent 745e92ab
Branches
Tags
No related merge requests found
......@@ -1109,9 +1109,16 @@ class CRM_Export_BAO_ExportProcessor {
) {
//check for custom data
if ($cfID = CRM_Core_BAO_CustomField::getKeyID($field)) {
$html_type = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $cfID, 'html_type');
//need to calculate the link to the file for file custom data
if ($html_type === 'File' && $fieldValue) {
$result = civicrm_api3('attachment', 'get', ['return' => ['url'], 'id' => $fieldValue]);
return $result['values'][$result['id']]['url'];
}
return CRM_Core_BAO_CustomField::displayValue($fieldValue, $cfID);
}
elseif (in_array($field, [
'email_greeting',
'postal_greeting',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment