Problem
I get the following error when upgrading a Drupal 6 database which had a UUID 6.x-1.0-rc2 module enabled:
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[error]
right syntax to use near 'AS , t.tid AS tid
FROM
taxonomy_term_data t
WHERE ( IN ('bcb92ce8-2236-e264-6' at line 1
Performed update: uuid_update_7103 [ok]
Diagnosis
Apparently a NULL value is supplied for $uuid_key in the db_select() of entity_get_id_by_uuid. This is because $info['entity keys']['uuid'] is not set.
Workaround
Add this to uuid.install right after entity_get_info() in uuid_update_7103():
if (!isset($info['entity keys']['uuid'])) continue;
Comments
Comment #1
kpaxman commentedI had this same issue in Drupal 7; removed the version # from the title and added "D7 upgrade" to the tags.
I tried the proposed workaround and got the following error:
PHP Fatal error: Cannot break/continue 1 level in uuid.install on line 243
Then I realized there was more than one entity_get_info() in the update hook. When I insert the workaround after the SECOND one, it works.
Attached is a patch for review.
Comment #2
skwashd commented@kpaxman thanks for the patch, but it does comply with the Drupal coding standards. Please resubmit the patch.
Comment #3
liam morlandFixed version attached. Thanks.
Comment #4
liam morlandReroll.
Comment #5
liam morlandReroll.
Comment #6
liam morlandComment #7
liam morlandPatch still applies. If anyone else has used this successfully, please RTBC.