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) »
  • cannot add or edit contacts
Pages: [1]

Author Topic: cannot add or edit contacts  (Read 949 times)

cpelham

  • Guest
cannot add or edit contacts
February 13, 2008, 07:27:21 pm
Can anyone help? I am now getting the following error whenever I try to add or edit a contact:

Sorry. A non-recoverable error has occurred.
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`)), 1452

Return to home page.

Error Details:

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

       
Code: [Select]
=> -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  1955 , 'civicrm_contact,1955' ,  1 ,  20080213192520 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  1955 , 'civicrm_contact,1955' ,  1 ,  20080213192520 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_log (entity_table , entity_id , data , modified_id , modified_date ) VALUES ('civicrm_contact' ,  1955 , 'civicrm_contact,1955' ,  1 ,  20080213192520 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm/civicrm_log`, CONSTRAINT `FK_civicrm_log_modified_id` FOREIGN KEY (`modified_id`) REFERENCES `civicrm_contact` (`id`))]"]
)


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: cannot add or edit contacts
February 14, 2008, 12:35:54 pm
The error indicates that CiviCRM thinks the logged in user is "linked to" a contact record whose ID is 1 (civicrm_contact.id = 1) - AND that contact record no longer exists. Generally - if a logged in user attempts to delete "their own" contact record - they are preventing from doing so. So I'm not sure how things got into this state ??

If you log out from your CMS (Drupal or Joomla) - and log back in - CiviCRM should create a new contact / or re-establish the link to an existing contact for your user - and this should fix things. If not, you'll need to post additional info / clues (including CMS you're using, CiviCRM version, any changes that might be related to this, etc.)
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • cannot add or edit contacts

This forum was archived on 2017-11-26.