CRM-18396: Type error when deduping contacts with custom file field
authordeb.monish <monish.deb@webaccessglobal.com>
Tue, 12 Apr 2016 20:22:36 +0000 (01:52 +0530)
committerdeb.monish <monish.deb@webaccessglobal.com>
Tue, 12 Apr 2016 20:22:36 +0000 (01:52 +0530)
CRM/Core/BAO/CustomField.php

index 50cf7d067eda947a5407eb206c83d00e27856df0..9634e840b4592447081070e6a408c766f336f6ac 100644 (file)
@@ -1230,8 +1230,14 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
           }
           else {
             // In other contexts show a paperclip icon
-            $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value);
-            $display = $icons[$value];
+            if (CRM_Utils_Rule::integer($value)) {
+              $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value);
+              $display = $icons[$value];
+            }
+            else {
+              //CRM-18396, if filename is passed instead
+              $display = $value;
+            }
           }
         }
         break;