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) »
  • Unable to register for event
Pages: [1]

Author Topic: Unable to register for event  (Read 973 times)

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Unable to register for event
March 28, 2010, 04:15:56 am
I created a new event and all of the profile/price set information and it looks great. When I try to register I get a FK constraint violation:

Code: [Select]
CONSTRAINT `FK_civicrm_value_annual_conference__c82d0f5e10d827c0` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_event` (`id`) ON DELE)
The problem is that the entity_id in the query is 9 but the civicrm_event id field should be 1.

How is the entity ID getting the value and how could it be wrong?

I am still learning the internals of CiviCRM so any help with this is greatly appreciated.

Thanks,
Q
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

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: Unable to register for event
March 29, 2010, 07:08:09 am

Event custom data should not show up on a registration page. Did you hack your DB manually?

Only participant custom data gets exposed in registration pages

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

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to register for event
March 29, 2010, 10:44:20 am
Hi Lobo,

The custom data type is set to Participant(Event Name) so the fields would only be available to participants of this specific event. I haven't done any hacking/customization beyond a small js snippet. This site was just recently set up and is only handling registrations for this one event.

What else could I have done wrong in my setup to cause this problem?

BTW, this may be related to the issue presented in another recent thread - http://forum.civicrm.org/index.php/topic,12227.0.html

Thanks for your help,
Q

« Last Edit: March 29, 2010, 11:11:10 am by qjensen »
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to register for event
March 30, 2010, 07:52:49 pm
I was comparing the problem db to another system that is working as expected and I noticed that the entity_id column of the custom data table is not a FK to any other table. Is there supposed to be a FK between the custom data table and any other table?
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

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: Unable to register for event
March 30, 2010, 08:01:50 pm

yes, the entity_id is an FK to the table that the custom group is extending

what version are you on? did you change the custom group settings and what it extends. there was a bug with this in 3.0.x version i think

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

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to register for event
March 31, 2010, 03:13:13 am
My Bad - I ran show create for both tables and they both have a FK for the entity_id field.

On a test version of the site I just dropped the table and recreated it with the correct foreign key and it seemed to solve the problem. Is this an OK solution? What are possible side effects of hacking the db like this?

Based on the post I referenced up thread it looks like I am not the only person who has seen this problem. Is there anything I can do to help troubleshoot and track down how and when it happened?

Thanks for your help,
Q
« Last Edit: March 31, 2010, 03:16:40 am by qjensen »
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

qjensen

  • I post frequently
  • ***
  • Posts: 141
  • Karma: 11
    • Scaled Solutions
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Unable to register for event
April 01, 2010, 02:29:10 am
OK - I found something even stranger

When I first set up the custom data for the event I selected the wrong custom data type - Event. When I realized my mistake, I removed that custom data type and created a new custom data type with the same name for Participant

I went in and tried to edit one of the existing registrants to see what would happen after I hacked the db as described above. I noticed that there were 2 sections with custom data that had the same name. The first one looked like the original custom data with the wrong type and the second one looked like my corrected version. Looking at the html source one section had the name of the first, incorrect, custom data type I created - Annual_Conference_2010_1 and the other section had the name of the correct custom data type - Annual_Conference_2010_2.

Somewhere there is a reference to that first custom data type, but I can't find it. I full text searched the db, emptied the civicrm_cache table and deleted all of the cache files for civicrm.

Any clues?

Thanks,
Q
Quint Jensen
Web Developer
Scaled Solutions
--" Remove the 'I want you to like me' notes from your forehead and place them where they truly will do the most good -- on your mirror!" Author Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Unable to register for event

This forum was archived on 2017-11-26.