Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
1. CCK version : 5.x-1.9
2. imagefield version : 5.x-2.5
3. permissions for your tmp and files directory. : 755
4. download method (public or private files) : public
When I've tried to upgrade from imagefield (Update 5) I got an error :
* Failed: UPDATE content_field_image_1 SET field_image_1_fid = 0 WHERE field_image_1_fid NOT IN (SELECT fid FROM {files})
* Failed: UPDATE content_field_gallery SET field_gallery_fid = 0 WHERE field_gallery_fid NOT IN (SELECT fid FROM {files})
* Failed: UPDATE content_field_img SET field_img_fid = 0 WHERE field_img_fid NOT IN (SELECT fid FROM {files})
Also, got 3 warning that are related to error above is : (I just pick one since I think they all all the same.)
* user warning: Table 'main.content_field_gallery' doesn't exist query: UPDATE content_field_gallery SET field_gallery_fid = 0 WHERE field_gallery_fid NOT IN (SELECT fid FROM files) in /public_html/includes/database.mysql.inc on line 174.
Imagefield still works fine with that failed update.
Comment | File | Size | Author |
---|---|---|---|
#4 | imagefield5_update_brackets.patch | 766 bytes | quicksketch |
Comments
Comment #1
quicksketchThanks for your report. I tested this out several times and ImageField asks CCK directly for which tables to update, so it's strange that it would get back tables that were not valid.
Could you answer these questions that might help prevent the same error for others?
- How many ImageFields do you have on your site?
- Did some other similar updates complete from imagefield_update_5?
- In your database, are there tables of some similar names (content_field_image, perhaps?)
- Are there tables in the database with a similar name only prefixed with "node_" instead of "content_" (node_field_image_1)?
My guess is that you have some "orphaned" fields on your site that CCK expects there still to be tables for, but they're missing for some reason, but without the above information I can't tell for sure.
Comment #2
ariflukito CreditAttribution: ariflukito commentedI have the same problem, in my case the table prefix doesn't get applied. If you see the OP's update statement, there is no curly bracket enclosing the table name.
Comment #3
quicksketchYep, I think you're right ariflukito: the same thing is going on in the FileField queue. #402912: SQL Error generated by update 6101 on upgrade
Comment #4
quicksketchI've fixed this with that attached patch. For anyone that experienced this problem, it's highly encouraged to apply this patch, then run the ImageField update 5 again. See #310047: Field is not removed from shared content_field_XXX table on delete and #402424: Cleanup Abandoned Database Rows Left Over from D5.
Comment #5
quicksketchComment #6
abx CreditAttribution: abx commentedThe update #5 from version 2.6 went through without any problem. Thank you.