We enabled multi language support in Civi 5.21.1 then tried to create a new custom field group with Select or Radio options. The error from the DB is below (***edit: This doesn't happen when adding fields to an existing Group):-
[db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_custom_field (custom_group_id , name , label , data_type , html_type , default_value , is_required , is_searchable , is_search_range , weight , help_pre , help_post , is_active , is_view , options_per_line , text_length , start_date_years , end_date_years , date_format , time_format , note_columns , note_rows , column_name , option_group_id , filter , in_selector ) VALUES ( 77 , 'Test_2' , 'Test 2' , 'String' , 'Radio' , NULL , NULL , NULL , 0 , 2 , NULL , NULL , 1 , NULL , NULL , 255 , NULL , NULL , NULL , NULL , 60 , 4 , 'test_2' , 204 , NULL , 0 ) [nativecode=1062 ** Duplicate entry '77' for key 'UI_label_custom_group_id_en_GB']"]
After doing some digging, it seems that two tables now have additional keys:-
custom_data_group has the key 'UI_title_extends_en_GB' custom_data_field has the key 'UI_label_custom_group_id_en_GB'
After disabling multi language support, the keys remain and we are still unable to add options.
Removing the keys from MySQL using the commands below resolves the error:-
alter table civicrm_custom_field drop index UI_label_custom_group_id_en_GB;
and for the group:-
alter table civicrm_custom_group drop index UI_title_extends_en_GB
Is it safe to enable multi language support without these keys?