"Country" multiselect custom field won't support more than 50-or-so countries
On dmaster.demo.civicrm.org ("Powered by CiviCRM 5.48.alpha1."):
- Create a custom field of type Country, set to multi-select, in any custom group
- Edit an entity using this custom field, and try to add more than 50-or-so countries to it.
- Trying to save this entity will generate fatal error: "DB Error: unknown error" (on our site running CiviCRM 5.35.2, the entity will save without error, but only the first 50-or-so options are saved in the field; additional options are truncated out; this difference may be due to mysql configuration rather than civicrm version.)
This appears to be due to the varchar(255)
column specification for the custom field storage.
On our own site, we resolved this by altering the column to varchar(2550)
; that's probably much larger than is needed, but by doing this we can now select all options in this field and save the entity without error, retaining all selected options.
E.g.
ALTER TABLE `civicrm_value_additional_contact_info_2` CHANGE `locations_43` `locations_43` varchar(2550);