From 4f2997e2fb8ba806052ac219eea7c6167ca3bcf3 Mon Sep 17 00:00:00 2001 From: yashodha Date: Fri, 30 Jan 2015 16:51:02 +0530 Subject: [PATCH] CRM-15877: fix for truncated prefix/suffix in export csv ---------------------------------------- * CRM-15877: prefix_id truncated on contacts export https://issues.civicrm.org/jira/browse/CRM-15877 --- CRM/Export/BAO/Export.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index d991ee3b01..facf871651 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1347,12 +1347,18 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c return; } + $lookUp = array('prefix_id', 'suffix_id'); // set the sql columns if (isset($query->_fields[$field]['type'])) { switch ($query->_fields[$field]['type']) { case CRM_Utils_Type::T_INT: case CRM_Utils_Type::T_BOOLEAN: - $sqlColumns[$fieldName] = "$fieldName varchar(16)"; + if (in_array($field,$lookUp)) { + $sqlColumns[$fieldName] = "$fieldName varchar(255)"; + } + else { + $sqlColumns[$fieldName] = "$fieldName varchar(16)"; + } break; case CRM_Utils_Type::T_STRING: -- 2.25.1