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) »
  • Stand Alone form constraint violation
Pages: [1]

Author Topic: Stand Alone form constraint violation  (Read 1858 times)

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Stand Alone form constraint violation
September 01, 2007, 04:53:10 am
I've made a profile that I want to use (usually) for anonymous users. When I put the form on the site, it looks fine, but ...


If I have filled in all of the required information I get
Quote
    Database Error Code: Cannot add or update a child row: a foreign key constraint fails, 1216

    Return to home page.

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_location (entity_table , entity_id , location_type_id , is_primary ) VALUES ('civicrm_contact' ,  1 ,  8 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [type] => db_error
    [user_info] => INSERT INTO civicrm_location (entity_table , entity_id , location_type_id , is_primary ) VALUES ('civicrm_contact' ,  1 ,  8 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_location (entity_table , entity_id , location_type_id , is_primary ) VALUES ('civicrm_contact' ,  1 ,  8 ,  0 )  [nativecode=1216 ** Cannot add or update a child row: a foreign key constraint fails]"]
)
[/quote]

If I have not filled in the required information I get taken to the backend of the site the form is from and get a list of missing information.


Cancel works just fine. :)



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: Stand Alone form constraint violation
September 01, 2007, 12:20:05 pm

By any chance did u delete location_type with id = 8? AFTER you created the profile? Thats most likely the cause of the below error.

I've added a constraint to trap this in CiviCRM 2.0 :)

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

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Stand Alone form constraint violation
September 03, 2007, 02:51:18 am
I did add a location type--I'm not sure about whether it was before or after.

So probably I need to rebuild the stand alone form?

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: Stand Alone form constraint violation
September 03, 2007, 11:44:54 am

yes, can u try that and see if it works. If not can u try to reproduce on our drupal demo

thanx

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

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: Stand Alone form constraint violation
September 04, 2007, 01:03:55 pm
Yes it seemed to.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Stand Alone form constraint violation

This forum was archived on 2017-11-26.