Had previously upgraded to 1.4 of image.module. Followed steps with major DB upgrade then and things work fine.
Top of image.module prior to update is:
// $Id: image.module,v 1.209.2.36 2007/07/06 15:22:19 drewish Exp $
Version upgraded to is:
// $Id: image.module,v 1.209.2.44 2007/08/22 22:38:28 drewish Exp $
This is from 1.4 -> 1.5 as I understand it.
On a development system with no other activity, removed all modules/image directory and replaced with 1.5.
Proceeded directly to upgrade.php script. Said image.module update 5 was required. Ran it. Said no action was taken.
Return to main site and all images are broken.
Traced this to the fact image_file_download function expects all DB filepath columns to be prefixed with data directory. Looking in the DB all ours are still 'image/blah.jpg'.
Looking in the image.install file notice paths were messed with in update 4 which has been skipped perhaps (sorry, do not recall what updates ran when we upgraded to 1.4).
Comments
Comment #1
hpk commentedI am having the same problem... I upgraded the image module from 5.x-1.4 to 5.x-1.5 and now the images are not showing up. Logs are full with error entries like:
On further experimentation, I found that if I remove the "system/" from the image path the image start showing once again. However, it is not feasible for me to change every path in every node. Is this an image module bug? How can I get my images back?
Comment #2
drewish commentedif you've got private file file transfers enabled it'll put the system into the URL...
Comment #3
raintonr commentedWe have private transfers on here too.
OK, so I just rolled the DB back to an old backup and re-ran the update script. It started from update 2 and did this:
So if this was skipped updates, it happens from there too.
Either way, it was fixed here by this update, YMMV:
Comment #4
drewish commentedcool, glad you got it working.
Comment #5
raintonr commentedNo offence, but just because the DB can be hacked after the fact doesn't mean this bug can be closed. That should happen only when the installer does the job or code knows what to do if that hasn't happened.
Comment #6
luebbe commentedI can only second that. Hacking the db doesn't solve the initial problem.
I think this issue is closely related to http://drupal.org/node/171524 (No images displayed and "Missing derivative images"), since I had the same messages all over the place.
I have updated to the dev version of the image module yesterday and got it do display images, but I think the module is still broken somehow.
I have file access set to private and the base path for files is not accessible via the web space. Drupal & the image module should create proper paths to the images from "/path/to/files"+"images"+"image.name". What happens is that when displaying the image, Drupal or the image module inserts "system" into the path, so that the url for the image is "http://my.site/system/files/images/image.name". This works, when the filepath db variable contains the absolute path to the image, starting from the root of the filesystem not the web server. If the filepath variable of the image just contains a relative path, the image is not found.
Newly added images also get an absolute filepath stored in the database which will break things, when the site is moved (directory layout, server changes, ...). I would expect that the value stored in filepath contains only "images/image.name" and the full path is created on the fly from filesystem-path variable + the content of filepath when the image is accessed.
Comment #7
pyutaros commentedSubsribing from possible duplicate issue @ http://drupal.org/node/176504.
Comment #8
raintonr commentedBump...
Just tried an upgrade 1.4 -> 1.8 and various images disappear (oddly some do not). Had completely forgotten about this fix which still works.
Can we have this rolled into the update code please?
Comment #9
sunIf someone outlines more precisely which queries need to be executed to fix this bug, I'll consider injecting an update.
Comment #10
raintonr commentedRe: #9. I'm talking about the single update statement shown bottom of #3.
Comment #11
joachim commentedIs this still an issue?
Comment #12
joachim commentedComment #13
sunSorry, without further information this issue can only be marked as won't fix.
Feel free to re-open this issue if you want to provide further information. Thanks.