CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error message when i try to edit a Contact
Pages: [1]

Author Topic: Error message when i try to edit a Contact  (Read 724 times)

goodforkids

  • Guest
Error message when i try to edit a Contact
November 14, 2009, 12:18:50 pm
Hi,
I received the following error message and details when I tried to edit a contact.  What should I do to prevent this?

Thanks, Nicholas

************
unrecoverable error
    Sorry. A non-recoverable error has occurred.

    DB Error: constraint violation

    Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`goodforkidscivicrm/civicrm_value_kids_2`, CONSTRAINT `FK_civicrm_value_kids_2_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_participant` (`id`) ON DELETE CASCADE), 1452

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_value_kids_2  ( child_coaching_scholarship_start_30,child_coaching_scholarship_locat_31,child_coaching_scholarship_coach_42,child_activity_7,child_art_type_8,child_sport_type_9,child_dance_type_10,child_coaching_scholarship_appli_26,child_coaching_scholarship_award_18,child_coaching_scholarship_day_1_33,child_coaching_scholarship_day_1_34,child_coaching_scholarship_day_1_35,child_coaching_scholarship_day_2_36,child_coaching_scholarship_day_2_37,child_coaching_scholarship_day_2_38,child_coaching_scholarship_day_3_39,child_coaching_scholarship_day_3_40,child_coaching_scholarship_day_3_41,coaching_scholarship_total_hours_56,entity_id ) VALUES ( null,'','','','','','',null,null,'','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm',0,153 ) ON DUPLICATE KEY UPDATE child_coaching_scholarship_start_30 = null,child_coaching_scholarship_locat_31 = '',child_coaching_scholarship_coach_42 = '',child_activity_7 = '',child_art_type_8 = '',child_sport_type_9 = '',child_dance_type_10 = '',child_coaching_scholarship_appli_26 = null,child_coaching_scholarship_award_18 = null,child_coaching_scholarship_day_1_33 = '',child_coaching_scholarship_day_1_34 = 'hh:mm  am/pm',child_coaching_scholarship_day_1_35 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_36 = '',child_coaching_scholarship_day_2_37 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_38 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_39 = '',child_coaching_scholarship_day_3_40 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_41 = 'hh:mm  am/pm',coaching_scholarship_total_hours_56 = 0 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`goodforkidscivicrm/civicrm_value_kids_2`, CONSTRAINT `FK_civicrm_value_kids_2_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_participant` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_value_kids_2  ( child_coaching_scholarship_start_30,child_coaching_scholarship_locat_31,child_coaching_scholarship_coach_42,child_activity_7,child_art_type_8,child_sport_type_9,child_dance_type_10,child_coaching_scholarship_appli_26,child_coaching_scholarship_award_18,child_coaching_scholarship_day_1_33,child_coaching_scholarship_day_1_34,child_coaching_scholarship_day_1_35,child_coaching_scholarship_day_2_36,child_coaching_scholarship_day_2_37,child_coaching_scholarship_day_2_38,child_coaching_scholarship_day_3_39,child_coaching_scholarship_day_3_40,child_coaching_scholarship_day_3_41,coaching_scholarship_total_hours_56,entity_id ) VALUES ( null,'','','','','','',null,null,'','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm',0,153 ) ON DUPLICATE KEY UPDATE child_coaching_scholarship_start_30 = null,child_coaching_scholarship_locat_31 = '',child_coaching_scholarship_coach_42 = '',child_activity_7 = '',child_art_type_8 = '',child_sport_type_9 = '',child_dance_type_10 = '',child_coaching_scholarship_appli_26 = null,child_coaching_scholarship_award_18 = null,child_coaching_scholarship_day_1_33 = '',child_coaching_scholarship_day_1_34 = 'hh:mm  am/pm',child_coaching_scholarship_day_1_35 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_36 = '',child_coaching_scholarship_day_2_37 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_38 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_39 = '',child_coaching_scholarship_day_3_40 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_41 = 'hh:mm  am/pm',coaching_scholarship_total_hours_56 = 0 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`goodforkidscivicrm/civicrm_value_kids_2`, CONSTRAINT `FK_civicrm_value_kids_2_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_participant` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_value_kids_2  ( child_coaching_scholarship_start_30,child_coaching_scholarship_locat_31,child_coaching_scholarship_coach_42,child_activity_7,child_art_type_8,child_sport_type_9,child_dance_type_10,child_coaching_scholarship_appli_26,child_coaching_scholarship_award_18,child_coaching_scholarship_day_1_33,child_coaching_scholarship_day_1_34,child_coaching_scholarship_day_1_35,child_coaching_scholarship_day_2_36,child_coaching_scholarship_day_2_37,child_coaching_scholarship_day_2_38,child_coaching_scholarship_day_3_39,child_coaching_scholarship_day_3_40,child_coaching_scholarship_day_3_41,coaching_scholarship_total_hours_56,entity_id ) VALUES ( null,'','','','','','',null,null,'','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm','','hh:mm  am/pm','hh:mm  am/pm',0,153 ) ON DUPLICATE KEY UPDATE child_coaching_scholarship_start_30 = null,child_coaching_scholarship_locat_31 = '',child_coaching_scholarship_coach_42 = '',child_activity_7 = '',child_art_type_8 = '',child_sport_type_9 = '',child_dance_type_10 = '',child_coaching_scholarship_appli_26 = null,child_coaching_scholarship_award_18 = null,child_coaching_scholarship_day_1_33 = '',child_coaching_scholarship_day_1_34 = 'hh:mm  am/pm',child_coaching_scholarship_day_1_35 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_36 = '',child_coaching_scholarship_day_2_37 = 'hh:mm  am/pm',child_coaching_scholarship_day_2_38 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_39 = '',child_coaching_scholarship_day_3_40 = 'hh:mm  am/pm',child_coaching_scholarship_day_3_41 = 'hh:mm  am/pm',coaching_scholarship_total_hours_56 = 0 [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`goodforkidscivicrm/civicrm_value_kids_2`, CONSTRAINT `FK_civicrm_value_kids_2_entity_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_participant` (`id`) ON DELETE CASCADE)]"]

**********************

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error message when i try to edit a Contact
November 14, 2009, 05:55:49 pm

u might want to upgrade your profile to indicate what specific civicrm version u r using (i hope its not 2.0.x)

r u sure the error is when editing a contact? seems like the custom group is extending participants which should not be exposed/written to when a contact is edited. Is this in the participant tab?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

goodforkids

  • Guest
Re: Error message when i try to edit a Contact
November 15, 2009, 11:19:36 pm
Thanks Lobo.  You were right in that originally I had designated a custom group as Participant then changed it in the database to Individual.  This is what caused the error.

I have re-created the group as an individual, deleted the original group, and can edit contacts without any issues.

Thanks,
Nicholas

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error message when i try to edit a Contact

This forum was archived on 2017-11-26.