1

I have a set of images provided by a view. They are displayed on the site home page via a panels page. JCarousel is used on display. An image cache style is applied. When previewed in the view, they appear without issue.

When displayed on the home page, the path to the images uses localhost, not the server domain name, and thus are broken. All other images on the site load fine, including other images provided by image cache.

I've tried:

  • Clearing the cache
  • Flushing the image cache style

I'm not really sure what else to check. Do I have any other options beyond settings base_url in the settings.php file?

  • 1
    Perhaps something domain-specific got copied over in your .htaccess file(s)? I would try overwriting .htaccess on my server with a .htaccess from a fresh copy of Drupal. – sheena_d Dec 23 '11 at 14:39
  • Thanks for all the good comments. Looks like this was related to our Drupal platform provider. – Justin Dec 24 '11 at 15:52
1

I have had a very similar issue before.

Basically, the problem I had was that the image path was saved as url, instead of being a relative path. If this is the case, the fix is fairly simple, simply go look at that node's attributes in the database, and change the url path to a relative paths.

If you are in doubt, a quick and dirty way to see if this is really the problem:

  1. Do a DB dump, with mysqldump or whatever you use,

  2. grep in that file for "http://localhost"

    grep -b3 -a3 "http://localhost" yoursqlfile.sql

    • The b and a flag are for the number of lines returned upon a text match before and after the match it is optional and can be tweaked to higher values if wanted/needed.

Now, if there is any reference in the sql data pointing to your http://localhost, in your node meta-data these 2 simple steps will quickly help identify where the offending nodes are. Just note the table and field names that grep found & the nid's and go change the values to relative paths using either the commandline, a script or php-myadmin!

Of course, there are many ways to do this I just pointed out a very general way of fixing your data so it is portable.

Good-luck, happy coding.

0

Sounds like you have a conflict in your settings file and your variables table.

Try disabling the site root in the settings file and enable just your database connection. Then make sure your file paths are validating under file settings.

  • Hmmm, thanks. We don't have the site root set in the settings file. – Justin Dec 20 '11 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.