Closed (cannot reproduce)
Project:
Image
Version:
6.x-1.0-beta3
Component:
image_attach
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2009 at 22:58 UTC
Updated:
20 Dec 2010 at 23:38 UTC
The Views Image Attach field stores (and therefore caches) the full path.
For example if you use your website with https:// and have caching enabled the source to the images will contain the https:// route. And if someone tries to view your website with http:// then maybee the images won't show up (Internet Explorer).
I would suggest to use relative path. Like: "/images/image.jpg"
Comments
Comment #1
joachim commentedI'm pretty sure it doesn't -- the image attach module stores a node ID and nothing more.
The views field handler then makes a link out of that. You're maybe hitting a caching problem?
Comment #2
slampy commentedI still don't understand why, because if I use the default view everything works great ("/"), but when I add a seperate Image Attach field the images starts to show up as "https:=//".
If you think this is a caching problem, do you have a solution for it?
Thanks.
Comment #3
joachim commentedHow do attached images look on the regular node display?
I'll reopen so I remember to look at this when I have time.
Though if anyone else wants to have a go at figuring this out... :)
Comment #4
slampy commentedI have normal caching enabled. I cache almost everything.
Here is the scenerio:
I clear my cache while visiting the https://www.domain.com website. I reload so the cache is populated.
Now I visit the http://domain.com website.

What I see in my blocks with image attach:
What I see on my frontpage with the default view:
Also the title and alt attributes are missing with the view.
Comment #5
slampy commentedGreat! The img tags dissapeared. Let's try again...
What I see in my blocks with image attach:
What I see on my frontpage with the default view:
Comment #6
joachim commentedThe views handler calls image_display() to make an IMG tag the same way an attaching node or even an image node would.
Must be some sort of caching and beyond the scope of this module, I'm afraid. Block caching maybe?
Comment #7
slampy commentedI turned off caching and now it works. But I need caching...
Do you have any idea how to fix this? Or what/where could be the problem. I use the Block Cache Alter module (http://drupal.org/project/blockcache_alter) with 'Cache once for everything (global)' settings, which basically enables the views cache mechanism.
Comment #8
slampy commentedBut can't the image module just use relative paths rather then inserting the domain to each img tag. This would fix the caching problem.
For example on the title with relative path I see:
On the img tags I always see the full path:
Comment #9
joachim commentedIn all cases it goes to file_create_url().
Find image_display() in image.module and output what file_create_url() gets in all cases.
Comment #10
joachim commented'needs review' means 'there is a patch here that needs testing'.
Though I need input from you if I'm to figure it out. Can you debug what happens in image_display()?
Comment #11
slampy commentedIt's really hard to debug on a production site, but this is what I found:
$node->images[$label] and file_create_url($node->images[$label]) works perfectly. I did see something strange, but only once and I couldn't reproduce it. The problem was, that file_create_url() forgot to put http://domain.com/files/images/image.jpg and I just saw files/images/image.jpg.
So the problem should be with theme() and it's attributes. I checked the $node variable and it was really strange.
When I checked a page with http://www.domain.com it worked perfectly, but with http://domain.com it didn't output anything. So I think the problem should be with this.
Also file_create_url($node->images[$label]) showed always the right URL but on the images the HTML source URL was wrong. So it doesn't always put out what the file_create_url() has created.
Comment #12
SamFlushing commentedI have the same problem
I got
192.168.56.101//usr/share/drupal6/data/images/UMRЪSTKATALOG OPEL 1994.thumbnail.jpg
instead of
192.168.56.101/data/images/UMRЪSTKATALOG OPEL 1994.thumbnail.jpg
How to fix this bug?
Comment #13
sunSorry, without further information this issue can only be closed as not reproducible.
Feel free to re-open this issue if you want to provide further information. Thanks.