Details
Description
Go to any event and then Edit event location, to clear state_province. You will get following error:
Error Details:
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => UPDATE civicrm_address SET location_type_id = 1 , is_primary = 0 , is_billing = 0 , street_address = 'Boulevard Albert II, 5' , supplemental_address_1 = NULL , supplemental_address_2 = NULL , city = 'Bruxelles' , state_province_id = 0 , postal_code_suffix = NULL , postal_code = '1000' , country_id = NULL , geo_code_1 = NULL , geo_code_2 = NULL WHERE ( civicrm_address.id = 89 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_20/civicrm_address`, CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`) ON DELETE SET NULL)]
[type] => DB_Error
[user_info] => UPDATE civicrm_address SET location_type_id = 1 , is_primary = 0 , is_billing = 0 , street_address = 'Boulevard Albert II, 5' , supplemental_address_1 = NULL , supplemental_address_2 = NULL , city = 'Bruxelles' , state_province_id = 0 , postal_code_suffix = NULL , postal_code = '1000' , country_id = NULL , geo_code_1 = NULL , geo_code_2 = NULL WHERE ( civicrm_address.id = 89 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_20/civicrm_address`, CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`) ON DELETE SET NULL)]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_address SET location_type_id = 1 , is_primary = 0 , is_billing = 0 , street_address = 'Boulevard Albert II, 5' , supplemental_address_1 = NULL , supplemental_address_2 = NULL , city = 'Bruxelles' , state_province_id = 0 , postal_code_suffix = NULL , postal_code = '1000' , country_id = NULL , geo_code_1 = NULL , geo_code_2 = NULL WHERE ( civicrm_address.id = 89 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm_20/civicrm_address`, CONSTRAINT `FK_civicrm_address_state_province_id` FOREIGN KEY (`state_province_id`) REFERENCES `civicrm_state_province` (`id`) ON DELETE SET NULL)]"]
)