[Zope-dev] Re: Zope 2.7.0 b3 regressions
Paul Winkler
pw_lists at slinkp.com
Mon Dec 8 10:56:05 EST 2003
On Mon, Dec 08, 2003 at 12:35:38PM +0100, Stefan H. Holek wrote:
> Note that this is one of my main points: It will be of little use to
> document usage of BASEPATH1+absolute_url(1) when '/'+absolute_url(1)
> appears to work (until it is far too late).
As a frequent (ab)user of '/'+absolute_url(1), which did indeed
bite me when i deployed to an "inside out" apache setup,
I thought I'd try this out... I think you
meant BASEPATH1+'/'+absolute_url(1)?
I put this in a page template called test_abs_url:
<p>Typical relative path using absolute_url(1):
<span tal:replace="python:'/' + here.absolute_url(1)" />
</p>
<p>BASEPATH1 is: <span tal:replace="request/BASEPATH1" /> </p>
<p>Better relative path using BASEPATH1 and absolute_url(1):
<span tal:replace="python:request['BASEPATH1']+here.absolute_url(1)" />
</p>
If I visit this at http://localhost:8080/ctimi/about/test_abs_url, I get:
Typical relative path using absolute_url(1): /ctimi/about
BASEPATH1 is:
Better relative path using BASEPATH1 and absolute_url(1): ctimi/about
^^
note, no leading slash
If I visit
http://localhost:18080/VirtualHostBase/http/www.foobar.com:80/VirtualHostRoot/_vh_foo/ctimi/about/abs_url_test
I get this:
Typical relative path using absolute_url(1): /ctimi/about
BASEPATH1 is: /foo
Better relative path using BASEPATH1 and absolute_url(1): /fooctimi/about
... definitely not right.
But your point is made - '/'+absolute_url(1) is clearly inadequate too.
If I change the template to use request['BASEPATH1']+'/'+here.absolute_url(1),
then I get this:
Typical relative path using absolute_url(1): /ctimi/about
BASEPATH1 is: /foo
Better relative path using BASEPATH1 and absolute_url(1): /foo/ctimi/about
... which looks correct to me.
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's CHEESY ENGINEER!
(random hero from isometric.spaceninja.com)
More information about the Zope-Dev
mailing list