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) »
  • DB Error: constraint violation when submitting an event form
Pages: 1 [2]

Author Topic: DB Error: constraint violation when submitting an event form  (Read 7999 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: DB Error: constraint violation when submitting an event form
October 05, 2012, 11:50:49 am
The site where I am having the similar issue with contributions, is NOT multi-lingual.
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DB Error: constraint violation when submitting an event form
October 05, 2012, 12:17:25 pm
Lobo - did you identify where it would create the participant fields? The problem I had with trying to debug is that I couldn't find any mechanism that would appear to make it create the custom fields as participant fields (rather than contact)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: DB Error: constraint violation when submitting an event form
October 07, 2012, 03:44:26 pm
Eileen - Did you make any progress on debugging this?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DB Error: constraint violation when submitting an event form
October 07, 2012, 10:09:35 pm
Wow - just spent an afternoon trying to figure out what is happening & while I don't have a patch I've found out where it is going wrong - it's occurring when the contact has a subtype - in this case 'staff'.

Where there is a subtype this query is returning a much larger set of custom fields than occurs without a subtype - including participant fields - causing the next create to try to save them as contact fields. (there is a function at the end of confirm:postprocess that saves contact fields - createProfileContact should bypass them)


Oct 08 06:27:56  [info] $SELECT *
 FROM civicrm_cache
 
 WHERE (  civicrm_cache.group_name  = 'contact fields' )  AND (  civicrm_cache.path  = 'custom importableFields Staff_0_0_0_0__0__0__1_6a657c34' )
 
 
 
 = /sites/euro/sites/all/modules/civicrm/CRM/Core/Error.php, backtrace, 448
/sites/euro/sites/all/modules/civicrm/packages/DB/DataObject.php, debug_query, 2359
/sites/euro/sites/all/modules/civicrm/packages/DB/DataObject.php, _query, 441
/sites/euro/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php, find, 69
/sites/euro/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php, getItem, 444
/sites/euro/sites/all/modules/civicrm/CRM/Core/BAO/CustomField.php, getFields, 1509
/sites/euro/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, formatCustomField, 1989
/sites/euro/sites/all/modules/civicrm/CRM/Contact/BAO/Contact.php, formatProfileContactParams, 1624
/sites/euro/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php, createProfileContact, 1081
/sites/euro/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php, updateContactFields, 533
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DB Error: constraint violation when submitting an event form
October 07, 2012, 10:12:45 pm
Lobo - can you re-do your attempt to replicate this - but edit the contact to have a subtype first?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: DB Error: constraint violation when submitting an event form
October 08, 2012, 08:05:35 am
Eileen -

When I changed the contact record to not have a sub-type, then I was able to submit a credit card contribution. 

What is weird, is for me this issue only impacted credit card contributions, not cash/check contributions.

Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: DB Error: constraint violation when submitting an event form
October 08, 2012, 01:26:54 pm
Ah the joys of complicated code  :D
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: DB Error: constraint violation when submitting an event form
October 09, 2012, 03:49:29 am
The problem has been fixed here - http://issues.civicrm.org/jira/browse/CRM-10979.

And also explained why / how it worked with cash/check payments.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: DB Error: constraint violation when submitting an event form
October 10, 2012, 06:43:17 am
Okay, thank you for this. I've just applied the patch and am awaiting user testing.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: DB Error: constraint violation when submitting an event form
October 10, 2012, 09:10:45 am
Confirmed, patch worked for me.

Thanks again!

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • DB Error: constraint violation when submitting an event form

This forum was archived on 2017-11-26.