From: yashodha Date: Tue, 13 Sep 2016 10:41:43 +0000 (+0530) Subject: CRM-19222 Export: temp table field length at least 255 for strings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f31fa3c92aa01b6683b00548405229fa3b8a2069;p=civicrm-core.git 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 --- 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;