[Zope] How to deal with the famous ZCatalog + SiteRoot bug?

Florent Guillaume fg@nuxeo.com
Wed, 15 May 2002 15:47:15 +0000 (UTC)


The thing to do in latests zopes (2.5.1) is to use the CatalogPathAware
ZClass instead of CatalogAware.

Florent


Garikoitz Araolaza  <gari@eibar.org> wrote:
> 
> The Zoper combining Catalogaware ZClasses and SiteRoot (or VHM) will 
> quickly find the well known bug that makes object catalog themselves with 
> the virtual path and not with the physical path.
> 
> I've found hundreds of Wikis and pages dealing with the problem and 
> possible solutions, but the only place somebody suggests me an understable 
> solution is in the Popoto installation documentation:
> 
> http://www.zope.org/Members/dgeorgieff/popoto/PopotoInstall
> 
> CORRECT A CatalogAware bug
> 
> CatalogAware Zclass have a small problem when working infront of Apache and 
> a VirtualHostMonster.
> You need to edit $HOMEZOPE/lib/python/Products/Zcatalog/CatalogAwareness.py 
> and change url() (start ligne 152):
>     ......
>     def url(self, ftype=urllib.splittype, fhost=urllib.splithost):
>        """Return a SCRIPT_NAME-based url for an object."""
>        uri = string.join(self.getPhysicalPath(), "/")
>        return urllib.unquote(uri)
> 
>     def summary(self, num=200):
>     .....
> 
> After restarting Zope it works fine.
> 
> Should I directly replace 15 lines of code with that couple of lines? Why 
> did the original programmer bother writing 15 when he could do it in 2 lines?
> 
> I promise to write a HOW-TO with the solution if I finally can fix the bug 
> in my sites.
> 
> Thanks.  ;-)
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com