Skip to content

Commit

Permalink
The _need__name__ protocol assigns a name to DTMLMethods implicitly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hathawsh committed Jun 7, 2001
1 parent 8d8c7ee commit 74e64d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
Python code.
"""

__version__='$Revision: 1.28 $'[11:-2]
__version__='$Revision: 1.29 $'[11:-2]

import sys, os, traceback, re, marshal
from Globals import DTMLFile, MessageDialog, package_home
Expand Down Expand Up @@ -183,6 +183,7 @@ def __init__(self, id):

ZPythonScriptHTML_editForm = DTMLFile('www/pyScriptEdit', globals())
manage = manage_main = ZPythonScriptHTML_editForm
ZPythonScriptHTML_editForm._setName('ZPythonScriptHTML_editForm')

security.declareProtected('Change Python Scripts',
'ZPythonScriptHTML_editAction',
Expand Down

0 comments on commit 74e64d1

Please sign in to comment.