[Zope-dev] Re: Bug in AbsoluteURL Adapter

Sebastian Wehrmann sw at gocept.com
Wed Nov 28 05:45:15 EST 2007


Philipp von Weitershausen schrieb:
> Sebastian Wehrmann wrote:
>> while using the AbsoluteURL Adapter in a view,
>
> By the way, you're using Five's AbsoluteURL adapter. (It's different 
> from the one in Zope 3). Also, the patch below seems to be for Five. 
> Would be good to mention that :).
You are right. I forgot to mention it because the mail was originally 
for the Five mailing list, which does not exist anymore, though.
>> Any comments?
>
> Can you round up a test that demonstrates how the current 
> implementation fails to cover your case and how your suggestion change 
> fixes that?
While trying to write a test it turned out, that it's not a problem in 
Five but in the interaction between Plone3 and Zope2/Five.

The problem we tried to solve was: We have a structure of Plone content 
objects. We wanted to access a particular one in a view which can be 
called anywhere. Therefore we registered this content object as an 
utility. It turned out, that this utility does not have a request after 
fetching it in our view with getUtility(). The request is needed to get 
an absolute URL of our content object.

We solved the problem temporarily with an adapter which overrides Five's 
AbsoluteURL adapter which contains the code from the patch.

Anybody an idea how to do this in a better way?

-- 
Sebastian Wehrmann

gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale · germany
www.gocept.com · work. +49 345 122988912 · fax. +49 345 12298891



More information about the Zope-Dev mailing list