I have drupal site running core 7.42 and Commerce 7x-1.11 with Commerce Registration and Entity Registration. The modules all seem to be working fine as I can create registration products and product displays and add registrations to pages and such.

The problem is when a user tries to add the registration to cart it produces the following 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
        '))  LIMIT 1 OFFSET 0' at line 1: SELECT registration.registration_id  
        AS entity_id, registration.type AS bundle, :entity_type AS  entity_type, 
NULL AS revision_id FROM {registration} registration WHERE (registration.entity_id 
         = :db_condition_placeholder_0) AND (registration.user_uid = :db_condition_placeholder_1) 
     AND (registration.state IN ()) LIMIT 1 OFFSET 0; Array ( [:db_condition_placeholder_0] => 5 
        [:db_condition_placeholder_1] => 1522 [:entity_type] => registration ) in EntityFieldQuery->execute() 
    (line 1192 of /home/phislub9/public_html/includes/entity.inc).

I'm not sure what is causing the error, or how to debug it. It looks like a bad query is getting passed to the a drupal_alter function to modify query's in entity.inc.


So, the error was the result of missing registration states. I found the details in this post on the Entity Registration Issue Queue Pdoexception Error. I added a default "active" registration state, and this solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.