From e7dcccf0000d27608e167383106f7e447d1c09dd Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 1 Aug 2014 15:49:08 +0100 Subject: [PATCH] CRM-15068 - Add api support for custom file fields --- CRM/Core/BAO/CustomValueTable.php | 4 ++++ CRM/Utils/Type.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 74beeed525..942663c7d5 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -553,6 +553,10 @@ AND cf.id IN ( $fieldIDList ) 'is_multiple' => $dao->is_multiple, ); + if ($cvParam['type'] == 'File') { + $cvParam['file_id'] = $fieldValue['value']; + } + if (!array_key_exists($dao->table_name, $cvParams)) { $cvParams[$dao->table_name] = array(); } diff --git a/CRM/Utils/Type.php b/CRM/Utils/Type.php index 68b0eed2d7..db78968623 100644 --- a/CRM/Utils/Type.php +++ b/CRM/Utils/Type.php @@ -160,10 +160,10 @@ class CRM_Utils_Type { break; case 'Positive': - // the below 2 are for custom fields of this type - // CRM-8925 + // CRM-8925 the 3 below are for custom fields of this type case 'Country': case 'StateProvince': + case 'File': if (CRM_Utils_Rule::positiveInteger($data)) { return $data; } -- 2.25.1