Hi, when I try to access node/*/registrations, I get this error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 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 1: SELECT sum(count) AS count FROM {registration} r WHERE (entity_id = :db_condition_placeholder_0) AND (entity_type = :db_condition_placeholder_1) AND (state IN ()) ; Array ( [:db_condition_placeholder_0] => 2000 [:db_condition_placeholder_1] => node ) in function registration_event_count() (Line: 614 in file /mysite/sites/all/modules/registration/registration.module).

I am using Registration 7.x-1.0-beta3 and Entity 7.x-1.x-dev.

Comments

SocialNicheGuru’s picture

I just got this to at the same url node/*/registrations

levelos’s picture

Status: Active » Postponed (maintainer needs more info)

Looks like you guys have don't have any states defined for the registrations. Maybe an upgrade path issue?

garpy’s picture

Don't know if this will help anyone but after getting a PDO exception changing the memory limit and restarting mysql everything worked. Cheers

I also used a dev version from (8/2/12 11:00 AM) instead of the one from July 20 on D.O.

SocialNicheGuru’s picture

you were right #2

Kebz’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Priority: Normal » Major
Issue summary: View changes

This is popping up in my log messages and I have no clue what's generating it.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 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 2: SELECT r.* FROM {registration} r WHERE (state IN ()) ; Array ( ) in registration_cron() (line 1129 of .../sites/all/modules/registration/registration.module).

This does not happen to me, so I have no idea how to generate this error at all. I wish I could so that I can get the "backtrace" info.

caxy4’s picture

@Kebz - did you upgrade the module or install fresh?

It's likely you don't have registration states defined as @levelos suggests in comment #2.
I asked if you upgraded or installed fresh because having no registration types for an existing registration sounds like it could only be caused by a faulty upgrade.

Kebz’s picture

Hi @caxy4

By "registration states" ... you mean the ones located here? "admin/structure/registration/registration_states"

I also have lots of "registration types" that I've created months ago and located on this path "admin/structure/registration/registration_types"

Regarding the "upgrade" .... I just noticed that there's a new upgrade to this module after I read your message.

I upgraded both of my sites. I'll wait a day to report back if I see that error on my message logs.

Thanks =)

Kebz’s picture

okay... it didn't take long for the error to pop up on both of my sites

PDOException: SQLSTATE[42000]: Syntax error or access violation: 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 2: SELECT r.* FROM {registration} r WHERE (state IN ()) ; Array ( ) in registration_cron() (line 1129 of .../sites/all/modules/registration/registration.module).

The "referrer" or "location" from the details of the message is coming from the root directory or an article.

Why would this error pop up on the message log if an anonymous user is browsing the site??

  • caxy4 committed 4b89be6 on 7.x-1.x
    Issue #1682130 - ensure we are not making database queries with an empty...
  • caxy4 committed b8b46cd on 7.x-1.x
    Issue #1682130 - check whether we have held states defined before using...
caxy4’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

@Kebz, I've found a few vulnerabilities in the code that may have caused the error you saw in the log.
I've fixed the vulnerability with commits b8b46cd and 4b89be6. Try using the latest version of the 7.x-1.x-dev branch and let me know if you still get the message.

In fact the commits referenced above should take care of this issue generally. Closing as fixed.

Kebz’s picture

@caxy4 - thank you!

I upgraded to the latest and so far so good =)