[Zope-Checkins] CVS: Zope2 - DTMLMethod.py:1.66 Image.py:1.130

shane@digicool.com shane@digicool.com
Thu, 7 Jun 2001 18:19:15 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak.digicool.com:/tmp/cvs-serv16812/OFS

Modified Files:
	DTMLMethod.py Image.py 
Log Message:
The _need__name__ protocol assigns a name to DTMLMethods implicitly
so that ExtensionClass can find the correct <name>__roles__ attribute
of the method's class.  However it was discovered that this protocol
has a flaw: if a DTMLMethod is bound to multiple names, there is no
way for default__class_init__ to tell which name is the right one.

This change adds code that detects the condition and makes the name
explicit in all places where it occurs in the Zope core.  There are
likely products out there that have the same condition so they will
need a small correction.  For now this is a warning but it might be
appropriate to later make the condition an error.



--- Updated File DTMLMethod.py in package Zope2 --
--- DTMLMethod.py	2001/05/24 19:44:17	1.65
+++ DTMLMethod.py	2001/06/07 22:18:44	1.66
@@ -265,6 +265,7 @@
         return full_read_guard(ob)
 
     manage_editForm=DTMLFile('dtml/documentEdit', globals())
+    manage_editForm._setName('manage_editForm')
 
     # deprecated!
     manage_uploadForm=manage_editForm

--- Updated File Image.py in package Zope2 --
--- Image.py	2001/04/23 15:39:11	1.129
+++ Image.py	2001/06/07 22:18:44	1.130
@@ -146,7 +146,7 @@
 
     manage_editForm  =DTMLFile('dtml/fileEdit',globals(),
                                Kind='File',kind='file')
-
+    manage_editForm._setName('manage_editForm')
     manage=manage_main=manage_editForm
     manage_uploadForm=manage_editForm
     
@@ -736,7 +736,7 @@
     manage_editForm  =DTMLFile('dtml/imageEdit',globals(),
                                Kind='Image',kind='image')
     view_image_or_file =DTMLFile('dtml/imageView',globals())
-
+    manage_editForm._setName('manage_editForm')
     manage=manage_main=manage_editForm
     manage_uploadForm=manage_editForm