problem with catalog and VHM
Hi, I'm having trouble with the apache RewriteRule. I'm using Zope 2.6.0 on a SuSE linux and the following RewriteRule works perfect with the site I developed. RewriteRule ^/(.*) http://127.0.0.1:8070/VirtualHostBase/https/foo.bar:443/VirtualHostRoot/$1 [L,P] The problem ist, that the folder in which the site is contained in is called /brk and I don't want to access the site via foo.bar/brk. Therefore I changed the RewriteRule into [...]/VirtualHostBase/https/foo.bar:443/brk/VirtualHostRoot/$1 [L,P] This seemed to work until I discovered that parts of the site (which use a catalog that is contained in the /brk folder named brkCatalog) don't work anymore. E.g. the funktion manage_afterAdd (which works perfect with the old rule) raises an AttributeError. manage_afterAdd(self, item, container): [...] self.brkCatalog.reindexIndex('publishDate', REQUEST=None) AttributeError: 'None' object has no attribute 'script' * Module Products.brkBerichtverwaltung.brkBerichtverwaltung, line * 33, in manage_bericht * Module Products.brkBerichtverwaltung.brkBerichtverwaltung, line * 113, in _addBericht * Module Products.brkBerichtverwaltung.bericht, line 19, in * manage_addBericht * Module OFS.ObjectManager, line 272, in _setObject * Module Products.brkBerichtverwaltung.bericht, line 46, in * manage_afterAdd * Module Products.ZCatalog.ZCatalog, line 455, in reindexIndex * Module Products.ZCatalog.ZCatalog, line 761, in resolve_url Any Ideas whats going wrong. MfG Steffen -- That you're not paranoid doesn't mean they aren't right behind you.
Steffen Hausmann wrote at 2003-4-2 18:05 +0200:
I'm having trouble with the apache RewriteRule.
I'm using Zope 2.6.0 on a SuSE linux and the following RewriteRule works perfect with the site I developed.
RewriteRule ^/(.*) http://127.0.0.1:8070/VirtualHostBase/https/foo.bar:443/VirtualHostRoot/$1 [L,P]
The problem ist, that the folder in which the site is contained in is called /brk and I don't want to access the site via foo.bar/brk. Therefore I changed the RewriteRule into
[...]/VirtualHostBase/https/foo.bar:443/brk/VirtualHostRoot/$1 [L,P]
This seemed to work until I discovered that parts of the site (which use a catalog that is contained in the /brk folder named brkCatalog) don't work anymore.
E.g. the funktion manage_afterAdd (which works perfect with the old rule) raises an AttributeError.
manage_afterAdd(self, item, container): [...] self.brkCatalog.reindexIndex('publishDate', REQUEST=None)
AttributeError: 'None' object has no attribute 'script'
Thus, pass in a real "REQUEST" rather than "None". You can use "self.REQUEST". Dieter
On Wed, Apr 02, 2003 at 08:59:14PM +0200, Dieter Maurer wrote:
Steffen Hausmann wrote at 2003-4-2 18:05 +0200:
I'm having trouble with the apache RewriteRule.
I'm using Zope 2.6.0 on a SuSE linux and the following RewriteRule works perfect with the site I developed.
RewriteRule ^/(.*) http://127.0.0.1:8070/VirtualHostBase/https/foo.bar:443/VirtualHostRoot/$1 [L,P]
The problem ist, that the folder in which the site is contained in is called /brk and I don't want to access the site via foo.bar/brk. Therefore I changed the RewriteRule into
[...]/VirtualHostBase/https/foo.bar:443/brk/VirtualHostRoot/$1 [L,P]
This seemed to work until I discovered that parts of the site (which use a catalog that is contained in the /brk folder named brkCatalog) don't work anymore.
E.g. the funktion manage_afterAdd (which works perfect with the old rule) raises an AttributeError.
manage_afterAdd(self, item, container): [...] self.brkCatalog.reindexIndex('publishDate', REQUEST=None)
AttributeError: 'None' object has no attribute 'script'
Thus, pass in a real "REQUEST" rather than "None". You can use "self.REQUEST".
That works, but there is another Problem, with another function. getItem(self, metaType, verband, REQUEST=None): for object in self.brkCatalog({'meta_type':metaType}): path = re.match("(.*)/edit/.+?/.+?", object.getObject().absolute_url()) The request that is passed to the funktion by a dtml-in call looks ok (it is not None), but another AttributeError occurs. AttributeError: 'None' object has no attribute 'absolute_url' * Module DocumentTemplate.DT_Util, line 201, in eval __traceback_info__: REQUEST * Module <string>, line 0, in ? * Module Products.Hauptverwaltung.Hilfsklasse, line 398, in * getItem This does also work with the old RewriteRule. Thanks. MfG Steffen -- That you're not paranoid doesn't mean they aren't right behind you.
Steffen Hausmann wrote at 2003-4-2 22:25 +0200:
....
Thus, pass in a real "REQUEST" rather than "None". You can use "self.REQUEST".
That works, but there is another Problem, with another function.
getItem(self, metaType, verband, REQUEST=None): for object in self.brkCatalog({'meta_type':metaType}): path = re.match("(.*)/edit/.+?/.+?", object.getObject().absolute_url())
The request that is passed to the funktion by a dtml-in call looks ok (it is not None), but another AttributeError occurs.
AttributeError: 'None' object has no attribute 'absolute_url'
Apparently, "getObject()" returned "None". Call "getPath()" instead and see what is strange with the path. If "getPath()" returns None, too, then you have a catalog inconsistency. If you get a true path, you can try to find out why "unrestrictedTraverse" is unable to resolve it into an object.
... This does also work with the old RewriteRule.
"CatalogAware" (rather than "CatalogPathAware") is known to have issues with virtual hosting. Maybe, this lies behind your problem. Viele Grüße Dieter
On Thu, Apr 03, 2003 at 08:14:28PM +0200, dieter@handshake.de wrote:
Steffen Hausmann wrote at 2003-4-2 22:25 +0200:
getItem(self, metaType, verband, REQUEST=None): for object in self.brkCatalog({'meta_type':metaType}): path = re.match("(.*)/edit/.+?/.+?", object.getObject().absolute_url())
The request that is passed to the funktion by a dtml-in call looks ok (it is not None), but another AttributeError occurs.
AttributeError: 'None' object has no attribute 'absolute_url'
Apparently, "getObject()" returned "None". Call "getPath()" instead and see what is strange with the path.
The path that is returned is ok (from the visitors point of view the url is correct; the /brk was stripped off).
If "getPath()" returns None, too, then you have a catalog inconsistency.
I think the problem occurs somewhere here. The old objects (which were catalog with the old RewriteRule (with the /brk in the url)) 'object identifier' has the /brk, but objects which were cataloged with the new RewriteRule don't have the /brk in their 'object identifier'. If I delete these items and reindex them by the catalog they have the missing /brk and the website works. MfG Steffen -- That you're not paranoid doesn't mean they aren't right behind you.
participants (3)
-
Dieter Maurer -
dieter@handshake.de -
Steffen Hausmann