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 attempting to register for Event as anonymous
Pages: [1]

Author Topic: Error when attempting to register for Event as anonymous  (Read 2154 times)

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Error when attempting to register for Event as anonymous
November 01, 2007, 02:03:41 pm
I need anonymous users to get prompted to login to Drupal (or create account) when they try to register for a CiviEvent. In Drupal access control, "authenticated users" have "register for events" and "profile listings and forms" permission. Anonymous users do not.

However, when an anonymous user clicks the "register now" link, they get a default Drupal "access denied" page. When I set this default page to "example.com/user" they get the login page (which is what I want). However, upon loggin in, I immediately see:
Code: [Select]
     Sorry. A non-recoverable error has occurred.

    Database Error Code: 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 'GROUP BY civicrm_participant.event_id' at line 9, 1064

    Return to home page.

Error Details:

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

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT   count(civicrm_participant.id) as total_participants,
                           civicrm_event.max_participants as max_participants,
                           civicrm_event.event_full_text as event_full_text 
                  FROM     civicrm_participant, civicrm_event
                  WHERE    civicrm_participant.event_id = civicrm_event.id
                     AND   civicrm_participant.status_id!=4
                     AND   civicrm_participant.is_test=0
                     AND   civicrm_participant.event_id=
                  GROUP BY civicrm_participant.event_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 'GROUP BY civicrm_participant.event_id' at line 9]
    [type] => DB_Error
    [user_info] => SELECT   count(civicrm_participant.id) as total_participants,
                           civicrm_event.max_participants as max_participants,
                           civicrm_event.event_full_text as event_full_text 
                  FROM     civicrm_participant, civicrm_event
                  WHERE    civicrm_participant.event_id = civicrm_event.id
                     AND   civicrm_participant.status_id!=4
                     AND   civicrm_participant.is_test=0
                     AND   civicrm_participant.event_id=
                  GROUP BY civicrm_participant.event_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 'GROUP BY civicrm_participant.event_id' at line 9]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT   count(civicrm_participant.id) as total_participants,
                           civicrm_event.max_participants as max_participants,
                           civicrm_event.event_full_text as event_full_text 
                  FROM     civicrm_participant, civicrm_event
                  WHERE    civicrm_participant.event_id = civicrm_event.id
                     AND   civicrm_participant.status_id!=4
                     AND   civicrm_participant.is_test=0
                     AND   civicrm_participant.event_id=
                  GROUP BY civicrm_participant.event_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 'GROUP BY civicrm_participant.event_id' at line 9]"]
)

Please guide me on how to properly prompt users to log in when they try to register for events. Thanks![/code]

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: Error when attempting to register for Event as anonymous
November 02, 2007, 02:16:44 am
Just edit the default Drupal access denied page.
---admin/settings/error-reporting

Create a new page node that says what you want and then point the 403 at that node.

That page should instruct users to login here with a link to the registration page. If I remember correctly, that works, whereas directly sending them to the registration page does not.
« Last Edit: November 02, 2007, 02:20:31 am by geilhufe »
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Re: Error when attempting to register for Event as anonymous
November 02, 2007, 08:18:00 am
Thanks. That improved things a bit. Seems that the huge MySQL error printing is gone, and users get prompted to log in. Sucks that they are taken to their user page instead of back to the CiviEvent page.

Anybody know how to have them redirected back to whatever they were trying to access, once they log in. Maybe more of a Drupal question  but I'm sure CiviCRM users need to know this. Thanks for the reply!

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
error is still there
November 02, 2007, 09:39:02 am
  • (not logged in) I click the event register link at example.com/civicrm/event/register?id=2&reset=1
  • Get the default Drupal access denied page or custom page.
  • Log in via login block on left. Admin or normal user, I am greeted with a big fat ugly full-page error as soon as I log in:
Code: [Select]
Database Error Code: 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 'GROUP BY civicrm_participant.event_id' at line 9, 1064
    I'm running a clean install of Drupal 5.3 with CiviCRM 1.9 stable. Any ideas?

    Dave Greenberg

    • Administrator
    • I’m (like) Lobo ;)
    • *****
    • Posts: 5760
    • Karma: 226
      • My CiviCRM Blog
    Re: Error when attempting to register for Event as anonymous
    November 02, 2007, 10:25:34 am
    I'm not sure what the solution is - but I can explain why you're getting that error... Basically the Event ID is getting lost when the Event Registration page is re-loaded after the login. I suspect the entire "query string" is lost.

    So instead of the redirect going to:
    example.com/civicrm/event/register?id=2&reset=1

    ... it's going to:
    example.com/civicrm/event/register

    ... and you can create the fatal error by requesting this URL on the demo.

    If you can figure out a way to do what you need while preserving the part of the link that comes after the ? - that will solve your problem.
    Protect your investment in CiviCRM by  becoming a Member!

    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 attempting to register for Event as anonymous
    November 03, 2007, 01:35:43 am

    I've fixed this in 1.9 to give a more reasonable error message if we dont get an event id.

    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

    Pages: [1]
    • CiviCRM Community Forums (archive) »
    • Old sections (read-only, deprecated) »
    • Support »
    • Using CiviCRM »
    • Using CiviEvent (Moderator: Yashodha Chaku) »
    • Error when attempting to register for Event as anonymous

    This forum was archived on 2017-11-26.