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 (Moderator: Dave Greenberg) »
  • Custom Fields creating database error
Pages: [1]

Author Topic: Custom Fields creating database error  (Read 856 times)

klkosi

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 2
  • CiviCRM version: 3.2.2
  • CMS version: Drupal 6.19
Custom Fields creating database error
September 27, 2010, 12:08:20 pm
Hi everyone,

I added a few custom fields to some of my civicrm profiles and whenever I try to use these forms to submit information, I get this error:

Code: [Select]

Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`civicrmpowarts/civicrm_value_professional_experience__resume_1`, CONSTRAINT `FK_civicrm_value_professional_exper_d2453118f9ed0d92` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contribution` ), 1452
Additional Details:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_value_professional_experience__resume_1  ( professional_background_6,what_kind_of_programming_and_eve_2,entity_id ) VALUES ( 'Test background','Stuff',1268 ) ON DUPLICATE KEY UPDATE professional_background_6 = 'Test background',what_kind_of_programming_and_eve_2 = 'Stuff' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrmpowarts/civicrm_value_professional_experience__resume_1`, CONSTRAINT `FK_civicrm_value_professional_exper_d2453118f9ed0d92` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contribution` )]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_value_professional_experience__resume_1  ( professional_background_6,what_kind_of_programming_and_eve_2,entity_id ) VALUES ( 'Test background','Stuff',1268 ) ON DUPLICATE KEY UPDATE professional_background_6 = 'Test background',what_kind_of_programming_and_eve_2 = 'Stuff' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrmpowarts/civicrm_value_professional_experience__resume_1`, CONSTRAINT `FK_civicrm_value_professional_exper_d2453118f9ed0d92` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contribution` )]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_value_professional_experience__resume_1  ( professional_background_6,what_kind_of_programming_and_eve_2,entity_id ) VALUES ( 'Test background','Stuff',1268 ) ON DUPLICATE KEY UPDATE professional_background_6 = 'Test background',what_kind_of_programming_and_eve_2 = 'Stuff' [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrmpowarts/civicrm_value_professional_experience__resume_1`, CONSTRAINT `FK_civicrm_value_professional_exper_d2453118f9ed0d92` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contribution` )]"]
)


Any idea what could be causing this and how to fix it?

Thank you!![/code]

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Custom Fields creating database error
September 27, 2010, 10:21:16 pm
There is a foreign key linking your table professional_experience to contribution that is probably not completely right? Check that definition?
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Custom Fields creating database error
July 25, 2011, 12:18:15 am
I'm having the same problem, how does this happen from a fresh install, and what is the solution?

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Custom Fields creating database error
July 25, 2011, 12:27:04 am
I have no idea how this can happen to a fresh install, never experienced the problem myself
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Custom Fields creating database error

This forum was archived on 2017-11-26.