Submitted by : 192.168.1.21 at: 2003-11-26T01:38:10+00:00 (14 years ago)
Name :
Category : Severity : Status :
Optional subject :  
Optional comment :

I'm using ZWiki (version ZWiki-0-20-0) and I had a problem which appeared to me as a bug.

My site is so structured

root
 |
 +- main_folder
 |   |
 |   +- plone_site
 |   |
 |   `- projects
 |       |
 |       `- my_project
 |           |
 |           `- zwiki
 |
 `- other_stuff

My apache server points to /main_folder/plone_site ,but acquisition ensures that I can access projects sites with URLs? like

  http://my_server/projects/my_project/zwiki

The problem is that zwiki thinks then that it belongs to the plone site, because CMFAwareness.inCMF checks that

  hasattr (self.aq_inner.aq_parent, portal_membership)

I interpret the use of aq_inner as an attempt to get rid of contextual acquisition, by opposition to containment acquisition.

If I am right, this is a bug, since aq_inner only gets rid of contextual acquisition in the closest level of wrapping, i.e. in my example

 main_folder.plone_site.projects.aq_inner.aq_parent is main_folder
but
 main_folder.plone_site.projects.my_project.aq_inner.aq_parent is projects
which in turn acquires from plone_site, contextually, though it is not contained by it.

Similarly, I found out that UI.py uses hasattr to get various forms either from the CMF skins or the Product, and gets fool by my site structure as well.

Hence, I suggest the attached patch on CMF.py and UI.py, which worked fine for me, by not getting fooled by "far" contextual acquisition.

IssueNo0655?-patch


comments:

thanks --simon, Wed, 26 Nov 2003 08:44:43 -0800 reply
I think you're right. How did this bug affect you ? Is it really serious ?

thanks --simon, Wed, 26 Nov 2003 08:48:36 -0800 reply
Oh I see - it thought you were in a plone site when you weren't.

Maybe this argues more strongly for your fix, but in general you can always break zope sites by giving them funny acquiring urls. I assume you can also simply not offer that problem url ?

property change --simon, Wed, 26 Nov 2003 22:14:11 -0800 reply
Severity: serious => normal

property change --simon, Mon, 05 Sep 2005 21:51:14 -0700 reply
Category: admin-configuring => other Status: open => closed

I can't reproduce this, and don't think it's a zwiki problem anyway.