[Zope] Re: ZDiscussions & SiteAccess

Evan Simpson evan@4-am.com
Wed, 29 Dec 1999 16:15:27 -0600


tonyr@ep.newtimes.com wrote:

> Upon further investigation the culprit appears to be the ablolute_url
> function in conjunction with SiteAccess and ZCatalog.  The entries in
> ZCatalog show:
>   /feedback/1999-12-16/film.html for the "broken" entries done via
> VirtualHost
>   /city/feedback/1999-12-16/film.html for the functional entries
>
> Upon still fruther investigation this problems also accures in the
> ZCache product when used under SiteAccess.

Urgh.  This is messy, because it shows a conflict between two distinct (but
easily confused) uses of absolute_url.

The first is in producing shortest-path URLs for client consumption (as
with Images).  In this case, you want virtually-hosted sites to produce the
shortened URL, and depend on the virtual hosting to add '/city' back in
when the URL is requested.

The second is in producing internal object-traversal paths, and should
really be given its own function (perhaps called absolute_path).  In this
case, virtual hosting should have *no* effect.  ZCatalog and ZCache both
use absolute_url in this way.

Unfortunately, fixing this will require surgery on each Product which uses
absolute_url improperly (IMNSHO).

So, two things need to be done:

1. An absolute_path function needs to be added to standard Items.
2. Product authors need to be encouraged to check their Products for
Virtual Hosting Compliance, i.e., using the new function where appropriate.

Gloom,

Evan @ 4-am