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) »
  • Error when registering to event [Solved]
Pages: [1]

Author Topic: Error when registering to event [Solved]  (Read 1963 times)

matahari87

  • Guest
Error when registering to event [Solved]
October 10, 2009, 02:55:35 pm
Hi all,

I set up a Profile and used that Profile in an Event Template.
With that Event Template I created an event.
Now I wanted to test if unregistered event registration works.
unfortunately, when i hit the "continue" button on the Page where i can register for the event, i encounter a mysql error:

Code: [Select]
Error Details:

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
  SELECT  participant.id, participant.contact_id
    FROM  civicrm_participant participant
   WHERE  participant.registered_by_id=2 AND participant.status_id !=  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3]
    [type] => DB_Error
    [user_info] =>
  SELECT  participant.id, participant.contact_id
    FROM  civicrm_participant participant
   WHERE  participant.registered_by_id=2 AND participant.status_id !=  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
  SELECT  participant.id, participant.contact_id
    FROM  civicrm_participant participant
   WHERE  participant.registered_by_id=2 AND participant.status_id !=  [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3]"]
)

I see, that the problem is that there is an empty string passed to MySQL, but the question i have to ask is: Why does this happen?

I hope you can help me,

Thanks a lot in advance!

Matahari87[/code]
« Last Edit: October 11, 2009, 12:20:00 pm by matahari87 »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error when registering to event
October 10, 2009, 05:16:14 pm
Did you "translate" or modify the Participant Status Label for "Cancelled". It looks like that might be how the bug is being triggered. You can try making this change and seeing if that prevents the error:

Line 139 in CRM/Event/PseudoConstant.php:
// change from this
          false, 'label', 'is_active', $cond, 'weight' );

// to this
          false, 'name', 'is_active', $cond, 'weight' );

Or assuming you've changed the "Cancelled" label - try changing it back to "Cancelled". If that fixes things, we'll figure out the complete fix - since this code change will cause the Participant Status on the backoffice "Register for Event" form to NOT display customized / translated labels.
Protect your investment in CiviCRM by  becoming a Member!

matahari87

  • Guest
Re: Error when registering to event
October 11, 2009, 03:07:38 am
Quote
Did you "translate" or modify the Participant Status Label for "Cancelled"
I don't even know where to do this  ;D

Anyway, your fix worked! Do you want me to do more testing to get an idea where exactly the error lies?
I have drupal with the german language pack installed, same for CiviCRM. So maybe the error is there?

Thanks a lot!!!

matahari87

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error when registering to event
October 11, 2009, 08:29:15 am
Looks like the bug IS triggered only on localised (non-English) installs. We'll post a formal patch in the next few days. Thx for testing the fix.
Protect your investment in CiviCRM by  becoming a Member!

matahari87

  • Guest
Re: Error when registering to event
October 11, 2009, 12:19:41 pm
Thank YOU for the fast help!
Really awesome!

Matahari87

grahamgilchrist

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 3
Re: Error when registering to event [Solved]
October 22, 2009, 05:05:38 am
Any update on this patch?

I just had the same issue on a localised (UK English) install.
We have several types of cancellation which need to be logged for reporting purposes, and since the 'cancelled' status cannot be disabled, I had to change it's label to avoid confusion arising with users. This seems to result in the same error.
Am happy to help with patch testing etc :)

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: Error when registering to event [Solved]
October 22, 2009, 08:53:11 am

the patch is here:

http://fisheye2.atlassian.com/changelog/~br=v3.0/CiviCRM/?cs=24186

this will be part of 3.0.2 which will be released next week

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

grahamgilchrist

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 3
Re: Error when registering to event [Solved]
October 22, 2009, 08:59:29 am
Awesome! I love this community :)

gravel

  • Guest
Re: Error when registering to event [Solved]
November 01, 2009, 08:58:31 pm
I also got the same error for membership with translated Member statuses. I am running 3.0.2. Was it supposed to have been solved in this version?

A.

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: Error when registering to event [Solved]
November 02, 2009, 08:19:03 am

please avoid piggybacking on another thread

please start a new thread and give us more details. Ideally if you can reproduce this issue on our demo server it would be great

thanx

lboo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

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

This forum was archived on 2017-11-26.