adding a folder with the id 'home' results in an attribute error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Silva |
Fix Released
|
Medium
|
Martijn Faassen |
Bug Description
In Silva 1.6 (at least) adding a folder with the id 'home' results in an attribute error. After initial investigation it seems that the mangle id validation fails because the class Folder or one of its ancestors exposes the attribute 'home'. Of course this means that acquisition is looking at the wrong things entirely. It also seems that when adding a folder successfully (i.e. with a different id) the mangle.Id._validate method is called twice for the folder (no I'm not mistakenly looking at the call for the default document, it is in fact called 3 times in total) which is weird.
If we look at mangle.py 197-198:
attr = getattr(
if attr is not _marker:
The first time folder.aq_inner is <Silva Root instance silva>, which is fine (folder.
<Products.
which is where I'm lost. Why the heck is it called twice? Anyway this is where it goes wrong because now:
folder.
i.e. a filesystem path to the Silva Product folder.
questions: why is mangle.Id._validate called twice, and why are its arguments different and *wrong* the second time?
faassen, when you're coming in, I need your help on this.
Changed in silva: | |
assignee: | nobody → faassen |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in silva: | |
status: | Confirmed → Fix Committed |
Changed in silva: | |
status: | Fix Committed → Fix Released |
Okay, it turned out that 'home' was actually reserved but this was un-reserved in 1.6. The same problem existed in Silva 1.5 and likely before too. The FactoryDispatcher has a home attribute and while it acquires everything else from the folder you're inheriting from, the 'home' attribute is there messing things up.
I've re-reserved the things that were unreserved (except for search) in Silva 1.6 branch, Silva 2 branch and trunk.