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 CiviEvent (Moderator: Yashodha Chaku) »
  • SQL Error on Event Registration
Pages: [1]

Author Topic: SQL Error on Event Registration  (Read 729 times)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
SQL Error on Event Registration
November 03, 2009, 11:13:46 am
When registering for an event in a Drupal 6 / CiviCRM 3.0.2 site I get this:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , unit_price , line_total ) VALUES ('civicrm_contribution' ,  5838 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d6_civicrm/civicrm_line_item`, CONSTRAINT `FK_civicrm_line_item_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES `civicrm_price_field` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_line_item (entity_table , entity_id , unit_price , line_total ) VALUES ('civicrm_contribution' ,  5838 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d6_civicrm/civicrm_line_item`, CONSTRAINT `FK_civicrm_line_item_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES `civicrm_price_field` (`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_line_item (entity_table , entity_id , unit_price , line_total ) VALUES ('civicrm_contribution' ,  5838 ,  0 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`d6_civicrm/civicrm_line_item`, CONSTRAINT `FK_civicrm_line_item_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES `civicrm_price_field` (`id`) ON DELETE CASCADE)]"
)

The constraint error appears to be that it needs the field price_field_id to correspond to a record in civicrm_price_field. But in the SQL statement quoted above, no value at all is provided for that field.

Something is amiss here. :(

.[/code]
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: SQL Error on Event Registration
November 03, 2009, 11:38:12 am
Talked to hershel on IRC and they're going to try recreating the price set for this event (this site has been upgraded multiple times from v1.9).
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • SQL Error on Event Registration

This forum was archived on 2017-11-26.