To reproduce:

- set up a multisite
- upload some filefield or imagefield files
- realize that you haven't been to set up admin/settings/file-system, and Drupal is going on the default
- go there and save the default value Drupal suggests, eg 'sites/domain.com/files'
- imagecache works fine, but the basic image does not. This is because the node outputs the path 'sites/domain.com/files/sites/domain.com/files/filefieldpath/image.png' in the IMG tag SRC.

This is because the database stores 'sites/domain.com/files/filefieldpath/image.png' and the prefix from the core files setting gets shoved in front.

Cache clearing did not work; I had to hack these in the DB by hand.

Comments

quicksketch’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

This is not a bug and I've explained it many times in the queue. Please search.

spencerfromsc’s picture

@joachim, were you able to resolve this issue? I'm having the exact same problem on some Drupal Commons 1.4 sites running on the Aegir Barracuda (nginx) platform. My impression was that the problem was with DC 1.4, since sites installed on the same platform using DC 1.3 are not experiencing any file path issues. I've searched through the issue history here, but most of the file path issues seem to involve duplicating the multisite file path, not truncating the base url.

Sorry @quicksketch, don't mean to muddy up your issue queue here, but if this is a frequent occurrence, maybe we could add it to the "frequent problems" page in the documentation. I promise...I looked there first.

joachim’s picture

I had to go into the database and remove the 'sites/domain.com/files/' prefix by hand from all the filepath fields.

One way or another this is a bug -- if not filefield, then Drupal core is Doing It Wrong. If the files directory variable isn't set, then the default value of that variable shouldn't be getting shoved into the DB.