Fix for SiteAccess bug affecting ZCatalog users
There's a subtle bug in current and older versions of SiteAccess which can cause ZCatalog and dependent Products to fail. If you use an Access Rule in your root folder which alters REQUEST.path (for virtual hosting purposes, for example) then all ZCatalogs will return incorrect objects. In Products/SiteAccess/ChangeBehaviors.py, delete lines 68 and 69, or comment them out so that they look like: #if allow_btr: self.before_traverse(object, response) #entry_name = '' This ought to fix the problem. Please let me know if it doesn't. If nobody says anything, this will become SiteAccess v0.2.1 Also, a word of warning: Since ZCatalog doesn't store information (such as the request's hostname and port) used to determine object access paths under virtual hosting, you should avoid adding objects to a Catalog via one virtual host (or raw access) and retrieving them via another. Cheers, Evan @ 4-am
Hi, I am using Zope 2.1.3 with SiteAccess 1.0.1. I am using the Apache Proxy method with SiteRoots to do virtual hosting. In one of my hosts, I would like to use KM|net News. This uses its own ZCatalog. I cannot get this to work and it defenitely refers to SiteAccess, as a KM|net News instance in the root of Zope, not affected by any rules works at once. The old fix to this At 19:05 Uhr -0600 11-1-00, Evan Simpson wrote:
In Products/SiteAccess/ChangeBehaviors.py, delete lines 68 and 69, or comment them out so that they look like:
#if allow_btr: self.before_traverse(object, response) #entry_name = ''
does not seem tp apply to this, as the code should have made it into SA 0.2.1 and at the mentioned lines, there is nothing similar to the above code around. Is there a solution to this damn SiteAccess/ZCatalog problem??? Regards and thanks for any info Jochen
There's a fix for this in the mailing list archives: http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/A6EA22132982ED44 Chris PS: Evan, this is the right one, isn't it? ;-)
----- Original Message ----- From: Jochen Haeberle <listen@MIDRAS.de>
Is there a solution to this damn SiteAccess/ZCatalog problem???
Yes: see http://www.zope.org/Members/4am/SiteAccess/patch Also, Zope will soon have changes to the way traversal works which will solve this once and for all. Cheers, Evan @ digicool & 4-am
Hi Evan, At 11:38 Uhr -0400 11-5-00, Evan Simpson wrote:
----- Original Message ----- From: Jochen Haeberle <listen@MIDRAS.de>
Is there a solution to this damn SiteAccess/ZCatalog problem???
thanks for the link. Is this accessable from the SiteAccess product page??? Applying the patch shifted the error to: Error Type: AttributeError Error Value: resolve_url <!-- Traceback (innermost last): File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 179, in publish File /serve/MIS-Zope-2.1.3/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 165, in publish File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: test) File /serve/MIS-Zope-2.1.3/lib/python/ZPublisher/Publish.py, line 102, in call_object (Object: test) File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLDocument.py, line 166, in __call__ (Object: test) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: test) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_With.py, line 148, in render (Object: Articles) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: index_html(_.None, _, category='top')) (Info: _) File <string>, line 0, in ? File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLMethod.py, line 146, in __call__ (Object: index_html) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: index_html) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: article_list(_.None,_,category=category, list_item=item_html)) (Info: category) File <string>, line 0, in ? File /serve/MIS-Zope-2.1.3/lib/python/OFS/DTMLMethod.py, line 146, in __call__ (Object: article_list) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: article_list) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob (Object: Catalog(searchfor)) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_With.py, line 133, in render (Object: getobject(data_record_id_, REQUEST)) File /serve/MIS-Zope-2.1.3/lib/python/DocumentTemplate/DT_Util.py, line 335, in eval (Object: getobject(data_record_id_, REQUEST)) (Info: getobject) File <string>, line 0, in ? File /serve/MIS-Zope-2.1.3/lib/python/Products/ZCatalog/ZCatalog.py, line 375, in getobject (Object: ElementWithAttributes) AttributeError: (see above) --> I thought this might be caused by my older 2.1.3 installation, so I upgraded to 2.1.6, but still get the same error :-( Any idea what might be _this_???
Also, Zope will soon have changes to the way traversal works which will solve this once and for all.
Good to hear - looking forward to this
Cheers,
Evan @ digicool & 4-am
Thanks for the tip - hoping for more Jochen
participants (4)
-
Chris Withers -
Evan Simpson -
Evan Simpson -
Jochen Haeberle