Wrong Imagecache File Path if User Changes "File System Path"

BenK - November 9, 2009 - 23:08
Project:ImageCache
Version:6.x-2.0-beta10
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hey everyone,

I've recently noticed a bug in the Imagecache filepath if the user ever changes the "File System Path" for the site (located at /admin/settings/file-system).

In our use case, we needed to change the file system path from the development server to the production server. Before using imagecache, we were able to handle this change with symlinks from the old files folder to the new files folder.

But once we use Imagecache, both the original file system path and the new file system path appear in the imagecache link to the image. Here's how the imagecache link looks once we change the file system path:

http://www.example.com/[newfilesystempath]/imagecache/[presetname]/[oldfilesystempath]/image.jpg

As a result, the imagecache version of the image doesn't display. Flushing the imagecache preset doesn't seem to work either because imagecache does not seem to know to regenerate the image if the file system path to the original image has been changed.

Any ideas for how to fix this? I think it would be best not to hard code the file system path directly into the imagecache link.

Thanks,
Ben

#1

teri@uhaaa.com - November 15, 2009 - 08:24

Hello!
I had the same problem. I've made this query in PHPMYadmin to replace the path

UPDATE files SET filepath = REPLACE(filepath,"sites/default/files/","")

I am not sure yet if this will work. I am trying now to fix my site.

#2

teri@uhaaa.com - November 15, 2009 - 08:25

Yeah, that works!
But I can't fix the node images to show, only the imagecache thumbs.

#3

teri@uhaaa.com - November 15, 2009 - 10:56

After that is enough to delete the caches. And my site is fixed now. I've fixed 3 sites in this way when moving them from different installations to one installation of Drupal.

 
 

Drupal is a registered trademark of Dries Buytaert.