[Zope] Folder "user" ------ it is a BUG?????

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 27 Jun 2002 16:22:32 +0100

On Thursday 27 Jun 2002 3:56 pm, Chris McDonough wrote:
> You are indeed right, this is a bug.  It happens because the
> editUser.dtml file references the name "user" without qualification, an=
> finds the "user" folder in the root before it finds the "user" argument
> passed in as a keyword.  I'm trying to figure out how to fix it now.

Oh yeah, sure, Zope is packed full of bugs like this. Its got alot better=
since Zope 2.0, but this is still a major problem.

Try this patch, which will dump out any name looked up but not found in t=
root application object. Next, go poking around inside the management=20
interface, or inside your favorite product.

Some of these do not indicate a problem, but most are caused by dtml or=20
acquisition-heavy code that uses the wrong namespace search order.

For every name listed, you can change the behaviour of Zope by adding an=20
object or property of the same name to the root folder.

Index: Application.py
RCS file: /cvs-repository/Zope/lib/python/OFS/Application.py,v
retrieving revision 1.183
diff -r1.183 Application.py
>     def __getattr__(self,n,k=3D{}):
>         if not k.has_key(n):
>             print >> sys.stderr,n
>             k[n]=3D0
>         raise AttributeError(n)