[Zope-Coders] Re: [ZC] 159/ 2 Comment "Image tags don't support VirtualHostsRoot"

Marc St-Jean marc@qcc.sk.ca
Fri, 18 Jan 2002 17:47:33 -0600


On Friday, January 18, 2002, at 02:36  PM, Collector: Zope Bugs and 
Patches ... wrote:

> Issue #159 Update (Comment) "Image tags don't support VirtualHostsRoot"
>  Status Pending, Zope/bug medium
> To followup, visit:
>   http://collector.zope.org/Zope/159
>
> ==============================================================
> = Comment - Entry #2 by matt on Jan 18, 2002 3:36 pm
>
> Can you amplify with example URLs?  What's the URL it is generating, vs 
> what it should be generating.

Yes, for example I have a site http://test.domain.ca/dir3/dir4. The Zope 
hierarchy is really /dir1/dir2/dir3/dir4 etc.

This site is redirected from Apache to Zope, and the VirtualHostRoot is 
really in dir2. Now any attempt to acquire an Image in dir1 from a DTML 
Method in say dir4 results in:
<img src="http://test.domain.ca/image" alt="Image" height="86" width="114"
  border="0" />

But of course the image isn't reachable there. The tag should have 
generate either an absolute URL:
<img src="http://test.domain.ca/dir3/dir4/image" alt="Image" height="86" 
width="114" border="0" />

or relative URL:
<img src="image" alt="Image" height="86" width="114" border="0" />

This works fine for DTML Documents and Methods, they are acquired without 
problem.
1. How can I make the Image produce either a virtual host aware or 
relative tag?

2. An alternative but much less convenient bug fix is to allow the 
Image.tag method to override the 'src' attribute instead of adding a 
second one to the end.

Although I think option 1. is by far the best solution, I think option 2. 
should also be fixed such that tags can be overridden for other reasons in 
the future.
Regards,
Marc


> ________________________________________
> = Request - Entry #1 by Anonymous User on Jan 18, 2002 3:17 pm
>
> The Image object doesn't generate the proper html tag when rendered from 
> a standard <dtml var> tag. This prevents them from being acquired from 
> higher up in the hierarchy than the VirtualHostRoot level. The src 
> attribute is not generated with the subpath below the virtual root.
>
> I tried using the Image.tag method and generating my own src attibute but 
> another bug prevents it from overiding the bad src attribute, it jsut 
> adds a second src attribute at the end which of course web browsers 
> simply ignore.
> This results in broken images icons on the web page and is a major 
> problem since it requires duplicating the same Image objects all over the 
> different virtual site hierarchies. Although I'm only an intermediate 
> Zope developer I'm fairly confident it's a bug since there are no 
> problems acquiring DTML Documents and Methods above the virtual root.
>
> ==============================================================
>
>
>
Marc St-Jean
QCC Communications Corp.
Saskatoon, SK, Canada
http://www.qcc.sk.ca