Images don't show in blocks

Events happening in the community are now at Drupal community events on www.drupal.org.
juliavdw's picture

I've got a site that I just ported from a local environment to a remote testing server. Everything is working fine except that an image that I put in a block does not show up! I have checked the path; all seems correct, and the permissions on that folder are 755 and 777 for the image itself.

The only way this site is different from others I am working on is that it is set up as a multisite.

I have my path set up as "sites/domain.com/files/image.png" (where it is), with all spelled correctly.

I also have tried "/sites/domain.com/files/image.png" to see if that slash made a difference but with same result.

I have also tried putting it in the "sites/all/default/files/images/.." folder where other, visible images live, but this likewise did not work.

Also tried putting it in the themes image directory with the same result.

Or is it not a path issue? This is the only image that is not part of the theme or part of a CCK field. By the way, the image code shows up in the source, so the code in the block is definitely there, and the block title shows up as well.

Thank you for any insight.
I expect the answer will seem simple and obvious but I haven't thought of it yet. :)

Comments

Can you access the image

criznach's picture

Can you access the image directly?

Like this:
http://example.com/sites/domain.com/files/image.png

Yes, I can see it that way

juliavdw's picture

It is fully visible through it's link directly.

There are a number of things

Garrett Albright's picture

There are a number of things which might be wrong here. Do you think you could share with us the exact HTML of one of the offending img tags?

Vibmish's picture

right, but the images dont show up - help please!

Have you checked the paths?

juliavdw's picture

Have you checked the paths? Do you have the correct permissions enabled? Is the image physically on the server?

I have checked that the paths in

Vibmish's picture

<img...

in the html source on the page show up correctly and the access to these images is set to 755 and they are all in
drupalroot/sites/default/files/ directory.

I can not see the images when I do for example in the browser http://192.168.1.101/drupal/sites/default/files/home.jpg

these images, wherever used on the sites in any module be it Photo Album or ddblock, DO NOT show up. This must be some setting problem since the images from the Theme that I am using DO SHOW UP.

I just went to the site to

juliavdw's picture

I just went to the site to share the html and imagine my shock and amazement to find a visible image? I have changed nothing in the code since yesterday.

I have no idea why it is working now and not before. I did all kinds of cache clearing, cron running and even ran updates to no avail.

Suddenly it is just working. ??? I mean, that's good but now I want to know why it IS working as opposed to earlier.

here is the link, in case you are still curious: http://test.vanderwykdesign.com/trudie/
it is the facebook icon.

Thank you for all your help, or willingness to help! I am interested to hear if anyone has experienced this style of mysterious server behavior. I do have another test site that will save one image but not another, almost identical one, all having accessible file permissions and everything. I guess it is just crazy image behavior week for me!

Ach.

Ah, it works on the front

Garrett Albright's picture

Ah, it works on the front page - but not on some/all of your subsequent pages. Try clicking on one of the "Tri Shop Events" links and you'll see the image is broken again.

It's because the path to that image is relative - it's "sites/trishopsantacruz.com/files/facebook_48.png". If you're looking at a web page at "http://test.vanderwykdesign.com/trudie/content/bike-rides", the browser will look for that image at "http://test.vanderwykdesign.com/trudie/content/sites/trishopsantacruz.com/files/facebook_48.png", which is wrong. But prefixing the image path with a slash won't work, because that will cause the path to be "http://test.vanderwykdesign.com/sites/trishopsantacruz.com/files/facebook_48.png" (omitting the "trudie" part). You'll need to prefix the path with "/trudie/" in order for it to work - but I'm betting the "/trudie/" won't be there when the site goes live, am I right?

I wrote the Pathologic module precisely to solve this sort of problem. I suggest you give it a try before fiddling with any paths. It should make things behave as expected automagically.

Aha, what do you know, a path

juliavdw's picture

Aha, what do you know, a path issue. :)

Yes, you are correct, the live site will be in the root. I will absolutely try out your module, thank you!

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: