[Zope] Re: SiteAccess breaks ZDConfera

Evan Simpson evan@digicool.com
Wed, 22 Mar 2000 17:20:43 -0500


----- Original Message -----
From: Alexander Staubo <alex@mop.no>


> Please send me the patch. The problem does not seem to have anything to
> do with URLs, but rather the objects indexed by the topic -- but I could
> be wrong here.
>
> Is there a way to modify ZDConfera/ZDiscussions to fix the problem,
> without patching ZPublisher? I wouldn't want to break something else in
> the process.

Without patching ZCatalog, you mean? Hmm.  Possibly.  If ZD* were patched to
use a subclass of ZCatalog which overrode resolve_url, that would work.
Here's the replacement resolve_url for ZCatalog:

    def resolve_url(self, path, REQUEST):
        """
        Attempt to resolve a url into an object in the Zope
        namespace. The url may be absolute (site-relative) or a catalog path
        style url. If no object is found, None is returned.
        No exceptions are raised.
        """
        pparts = filter(None, string.split(path, '/'))
        try:
            obj = getattr(self.aq_parent, pparts.pop(0))
            while pparts:
                obj = obj[pparts.pop(0)]
            return obj
        except:
            return

Cheers,

Evan @ digicool & 4-am