Skip to content
Snippets Groups Projects
Commit b4db5bb7 authored by akosgarai's avatar akosgarai
Browse files

#2645 Change column definition for preferred_mail_format field

A localized value for this field does not fit into the original varchar(8)

#2645 Update testcases
parent 31a216fe
No related branches found
No related tags found
No related merge requests found
......@@ -1464,7 +1464,16 @@ class CRM_Export_BAO_ExportProcessor {
case CRM_Utils_Type::T_STRING:
if (isset($fieldSpec['maxlength'])) {
return "`$fieldName` varchar({$fieldSpec['maxlength']})";
// A localized string for the preferred_mail_format does not fit
// into the varchar(8) field.
// @see https://lab.civicrm.org/dev/core/-/issues/2645
switch ($fieldName) {
case 'preferred_mail_format':
return "`$fieldName` varchar(16)";
default:
return "`$fieldName` varchar({$fieldSpec['maxlength']})";
}
}
$dataType = $fieldSpec['data_type'] ?? '';
// set the sql columns for custom data
......
......@@ -2555,7 +2555,7 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
'image_url' => '`image_url` longtext',
'preferred_communication_method' => '`preferred_communication_method` varchar(255)',
'preferred_language' => '`preferred_language` varchar(5)',
'preferred_mail_format' => '`preferred_mail_format` varchar(8)',
'preferred_mail_format' => '`preferred_mail_format` varchar(16)',
'hash' => '`hash` varchar(32)',
'contact_source' => '`contact_source` varchar(255)',
'first_name' => '`first_name` varchar(64)',
......@@ -2743,7 +2743,7 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
'image_url' => '`image_url` longtext',
'preferred_communication_method' => '`preferred_communication_method` varchar(255)',
'preferred_language' => '`preferred_language` varchar(5)',
'preferred_mail_format' => '`preferred_mail_format` varchar(8)',
'preferred_mail_format' => '`preferred_mail_format` varchar(16)',
'hash' => '`hash` varchar(32)',
'contact_source' => '`contact_source` varchar(255)',
'first_name' => '`first_name` varchar(64)',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment