CRM-15068 - Add api support for custom file fields
authorColeman Watts <coleman@civicrm.org>
Fri, 1 Aug 2014 14:49:08 +0000 (15:49 +0100)
committerColeman Watts <coleman@civicrm.org>
Fri, 1 Aug 2014 14:49:08 +0000 (15:49 +0100)
CRM/Core/BAO/CustomValueTable.php
CRM/Utils/Type.php

index 74beeed525e579ad96beb6b8d7990d2ac487f997..942663c7d56095aff0a3a3369e28001874218be8 100644 (file)
@@ -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();
         }
index 68b0eed2d74f6df97144aed54380290d79cbcd66..db7896862394338827aa62e11420737062ef1d83 100644 (file)
@@ -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;
         }