I ran into this when disabling my customer_profile_type_ui module:
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: UPDATE {commerce_customer_profile} SET status=:db_update_placeholder_0 WHERE (type IN ()) ; Array ( [:db_update_placeholder_0] => 0 ) in commerce_customer_modules_disabled() (line 311 of ....../commerce/modules/customer/commerce_customer.module)
There is a simple fix for this in the commerce_customer.module function commerce_customer_modules_disabled(). You just need to check that the array of profile types returned is not empty. The customer_profile_type_ui module may infact return an empty array if you had not added any profile types to begin with or if you delete all your profile types before disabling the module. So this check is needed. Otherwise I will have to hack it by returning a fake profile definition like 'blargedyblargblarg' ... which I would rather not do. :)
I will supply a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | commerce_customer_PDOException_no_customer_profile_types_1934142_1.patch | 3.33 KB | acrazyanimal |
Comments
Comment #1
acrazyanimal commentedPatch is git aware. :)
Comment #1.0
acrazyanimal commentedadded a link to the customer_profile_type_ui module.
Comment #2
rszrama commentedWhy does your module implement the hook and not return a profile type?
Comment #3
acrazyanimal commentedThe module is a UI for building custom profile types. So out of the box it doesn't come with any defined. You have to create them. So if someone enables the module and then disables it without adding any new types or happens to delete all of their profile types before disabling then it will return an empty array.
Comment #4
rszrama commentedAlrighty, ran a test and confirmed the current query doesn't work even if you just attempt it with an empty array. Committed the fix. Thanks!
Comment #5.0
(not verified) commentedmessed up the url