From f31fa3c92aa01b6683b00548405229fa3b8a2069 Mon Sep 17 00:00:00 2001 From: yashodha Date: Tue, 13 Sep 2016 16:11:43 +0530 Subject: [PATCH] CRM-19222 Export: temp table field length at least 255 for strings ---------------------------------------- * CRM-19222: Data too long on export including custom field https://issues.civicrm.org/jira/browse/CRM-19222 --- CRM/Export/BAO/Export.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index 6077d1a83d..9e762f92ed 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -1378,7 +1378,8 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c switch ($query->_fields[$field]['data_type']) { case 'String': - $length = empty($query->_fields[$field]['text_length']) ? 255 : $query->_fields[$field]['text_length']; + // May be option labels, which could be up to 512 characters + $length = max(512, CRM_Utils_Array::value('text_length', $query->_fields[$field])); $sqlColumns[$fieldName] = "$fieldName varchar($length)"; break; -- 2.25.1