I am just starting with Drupal, and ran into this issue with Image module and pictures not displaying.
I have multi-site install of Drupal 6.2 installed in home/site1/public_html/drupal-6.2
I started with development version of dev.site2.com with symbolic link created using
ln -s /home/site1/public_html/drupal-6.2 /home/site2/public_html/dev
and it worked fine with images located in drupal/sites/dev.site2.com/files/images
Then to make website live I renamed drupal/sites/dev.site2.com to drupal/sites/site2.com and changed symbolic link by using
ln -s /home/site1/public_html/drupal-6.2 /home/site2/public_html
As a result the site works, however pictures I uploaded earlier are not displaying. I can upload new pictures using image module, with the location showing as http://site2.com/sites/site2.com/files/images/ when it's supposed to be http://site2.com/files/images/
The image files are located in the correct directory drupal/sites/site2.com/files/images
What am I doing wrong?
Comments
Comment #1
hyperfine commentedI tried to disable the Image module, then re-enable again, but that did not help; I am at a loss at what to do...
Comment #2
hyperfine commentedI thought this problem might have an easy solution since I am a beginner with Drupal. Does the absence of replies means that this is a difficult issue?
Comment #3
Hetta commentedPossibly
- nobody else has the problem
- nobody else runs 6.x-1.x-alpha1
or a combination of the two.
Comment #4
strellman commentedDrupal6 has a new default location for files that includes the domain name. For example sites/2tell.org/files
This is a problem if you change your domain name or try to move the files directory someplace else because this path gets stored in various places in the database. Hence the warning:
Changing this location will modify all download paths and may cause unexpected problems on an existing site
These comments I found especially helpful in moving the default path for images.
http://drupal.org/node/205000#comment-675868
http://drupal.org/node/205000#comment-675077
http://drupal.org/node/205000#comment-678050
When I used phpMyAdmin
I chose to add a subdir rather than remove the files/ as in the example given.
update files set filepath = REPLACE(filepath, "files/", "files/story/")
I also struggled with the variable table, but not successfully. My recommendation is to open your theme in drupal, delete color specific files with your File Manager, then save the theme to recreate those files in the new location.
In the future I will always setup drupal with the default location as files/subdir where subdir is a name that will stay with this site no matter what the domain name is, whether it is a development site, or in a multisite environment.
http://2tell.org
Comment #5
Hetta commentedComment #6
strellman commentedSorry, it had been a long day and I moved 2 sites so my sql statement didn't match the example (and didn't work).
If you want to move files (especially images) from sites/2tell.org/files to files/2tell
1. Backup your database
2. go to phpMyAdmin
3. browse the files table
4. execute the sql command:
update files set filepath = REPLACE(filepath, "sites/2tell.org/files/", "")
This should leave just images/img_003.jpg
So the feature request is: Don't put the default file location in the image information in the files table!
Comment #7
JoelLonbeck commentedThanks! I was having this same problem and to work around it I was keeping the old file system folder (ex. testsite.com) and then just using the new one (ex. newtestsite.com) for the settings.php, which wasn't desirable for consistency reasons.
But now my site works and isn't cluttered by old folders. Thanks a lot
Comment #8
sunSeems this issue has been fixed.