How to deal with the famous ZCatalog + SiteRoot bug?
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. ;-) Gari _________________________________________________________ Aurki Euskara hutsezko bilatzailea http://www.aurki.com Zure laguntza behar dugu. Egin zaitez editore!
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
At 17:47 15/05/02, you wrote:
The thing to do in latests zopes (2.5.1) is to use the CatalogPathAware ZClass instead of CatalogAware.
Florent
OK, but updating a Zope 2.4.3 to 2.5.1 could be much more work than just replacing some lines in a method. I just wanted to know if I can securely delete all those 15 lines to be replaced by the new code. You could maybe give me some hints about it... Thanks Gari _________________________________________________________ Aurki Euskara hutsezko bilatzailea http://www.aurki.com Zure laguntza behar dugu. Egin zaitez editore!
Sorry I can't help you there, I don't use ZClasses. I just saw that bit about CatalogPathAware on the lists. Florent Garikoitz Araolaza <gari@eibar.org> wrote:
At 17:47 15/05/02, you wrote:
The thing to do in latests zopes (2.5.1) is to use the CatalogPathAware ZClass instead of CatalogAware.
Florent
OK, but updating a Zope 2.4.3 to 2.5.1 could be much more work than just replacing some lines in a method.
I just wanted to know if I can securely delete all those 15 lines to be replaced by the new code. You could maybe give me some hints about it... -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
Garikoitz Araolaza wrote:
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 am more interrested in getting my hand on the _person_ that created a method called "url" in one of the standard modules. Was it really that hard to imagine that some class "might" want to have an attribute called url sometime in the future??? So creating a class and making it catalog aware makes one spend several hours finding out why ones class does not work. And it turns out that the simple attribute called 'url' was the problem. Oh did I mention that this happened to A Friend Of Mine? regards Max M
participants (3)
-
Florent Guillaume -
Garikoitz Araolaza -
Max M