A contact is attempting to transfer registration for an event to another contact in CiviCRM version 7.x-5.12.3. It's an old installation that has been upgraded numerous times.

They receive the following error:

DB Error: constraint violation

In the logs we have the following information:

[db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_participant (event_id , status_id , role_id , register_date , source , is_test , is_pay_later ) VALUES ( 232 ,  1 , '4' ,  20200203 , 'Our Event' ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`von_civicrm_backup`.`civicrm_participant`, CONSTRAINT `FK_civicrm_participant_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]

I'm not sure how to fix this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.