[Zope-CMF] Strange error in Plone .9.9.almost with CMF-1.3b1
Peter Herndon
tpherndon@hotmail.com
Fri, 05 Apr 2002 16:10:24 -0500
Alan, Chris, Tres,
I just downloaded 0.9.9.almost, installed it, entered as "admin", created a
folder in root successfully, then attempted to create a Topic item in the
folder. I changed the ID, the Title, added a Summary, but left "Acquire
Criteria" checked as per default. I clicked the "Change" button, and
received the following traceback:
Traceback (innermost last):
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/ZPublisher/Publish.py,
line 150, in publish_module
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/ZPublisher/Publish.py,
line 114, in publish
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/Zope/__init__.py,
line 158, in zpublisher_exception_hook
(Object: Topic,2002-04-05,1018018238740620360)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/ZPublisher/Publish.py,
line 98, in publish
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/ZPublisher/mapply.py,
line 88, in mapply
(Object: topic_editTopic)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/ZPublisher/Publish.py,
line 39, in call_object
(Object: topic_editTopic)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/Products/CMFCore/FSPythonScript.py,
line 88, in __call__
(Object: topic_editTopic)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 252, in __call__
(Object: topic_editTopic)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 283, in _bindAndExec
(Object: topic_editTopic)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/Products/CMFCore/FSPythonScript.py,
line 122, in _exec
(Object: topic_editTopic)
(Info: ({'script': <FSPythonScript instance at 1bccc50>, 'context':
<Topic instance at 1ac1580>, 'container': <CMFSite instance at 1555f60>,
'traverse_subpath': []}, (<h3>form</h3><table><tr valign="top"
align="left"><th>field_id</th><td>'TrainingTopic'</td></tr><tr valign="top"
align="left"><th>field_description</th><td>'This topic should provide a
listing of all training-related documents'</td></tr><tr valign="top"
align="left"><th>acquireCriteria</th><td>'1'</td></tr><tr valign="top"
align="left"><th>field_title</th><td>'Training Documents'</td></tr><tr
valign="top"
align="left"><th>topic_editTopic</th><td>'Change'</td></tr></table><h3>cookies</h3><table><tr
valign="top"
align="left"><th>tree-s</th><td>'eJzTiFZ3hILgvHRb9VgdTQAw1QTx'</td></tr><tr
valign="top"
align="left"><th>GUID</th><td>'D27AA0C8A86911D3A96708C75D38AF'</td></tr><tr
valign="top" align="left"><th>dtpref_rows</th><td>'20'</td></tr><tr
valign="top"
align="left"><th>_ZopeId</th><td>'68777676A0PgCXUB39U'</td></tr><tr
valign="top" align="left"><th>dtpref_cols</th><td>'65'</td></tr><tr
valign="top"
align="left"><th>SITESERVER</th><td>'ID=2562f22b4c6e85957f05d0d4920dc20a'</td></tr><tr
valign="top"
align="left"><th>tutorialExamplesURL</th><td>'http://msk-115-70.mskcc.org:8080/MyZopeTutorial/examples'</td></tr></table><h3>lazy
items</h3><table><tr valign="top"
align="left"><th>SESSION</th><td><Python Method object at
0x1a25ae0></td></tr></table><h3>other</h3><table><tr valign="top"
align="left"><th>_ZopeId</th><td>'68777676A0PgCXUB39U'</td></tr><tr
valign="top" align="left"><th>field_description</th><td>'This topic should
provide a listing of all training-related documents'</td></tr><tr
valign="top"
align="left"><th>BASE2</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest'</td></tr><tr
valign="top" align="left"><th>dtpref_rows</th><td>'20'</td></tr><tr
valign="top"
align="left"><th>URL1</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360'</td></tr><tr
valign="top"
align="left"><th>BASE4</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training'</td></tr><tr
valign="top" align="left"><th>dtpref_cols</th><td>'65'</td></tr><tr
valign="top"
align="left"><th>BASE3</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest'</td></tr><tr
valign="top"
align="left"><th>SITESERVER</th><td>'ID=2562f22b4c6e85957f05d0d4920dc20a'</td></tr><tr
valign="top"
align="left"><th>BASE1</th><td>'http://msk-115-70.mskcc.org:8080'</td></tr><tr
valign="top" align="left"><th>traverse_subpath</th><td>[]</td></tr><tr
valign="top" align="left"><th>id</th><td>'TrainingTopic'</td></tr><tr
valign="top"
align="left"><th>URL0</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_editTopic'</td></tr><tr
valign="top"
align="left"><th>SERVER_URL</th><td>'http://msk-115-70.mskcc.org:8080'</td></tr><tr
valign="top" align="left"><th>AUTHENTICATED_USER</th><td>admin</td></tr><tr
valign="top"
align="left"><th>TraversalRequestNameStack</th><td>[]</td></tr><tr
valign="top"
align="left"><th>BASE6</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_editTopic'</td></tr><tr
valign="top"
align="left"><th>BASE5</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360'</td></tr><tr
valign="top" align="left"><th>AUTHENTICATION_PATH</th><td>''</td></tr><tr
valign="top" align="left"><th>field_title</th><td>'Training
Documents'</td></tr><tr valign="top"
align="left"><th>GUID</th><td>'D27AA0C8A86911D3A96708C75D38AF'</td></tr><tr
valign="top" align="left"><th>PUBLISHED</th><td><FSPythonScript instance
at 1bccc50></td></tr><tr valign="top"
align="left"><th>URL3</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest'</td></tr><tr
valign="top"
align="left"><th>PATH_INFO</th><td>'/PloneTest/ploneTest/Training/Topic,2002-04-05,1018018238740620360/topic_editTopic'</td></tr><tr
valign="top" align="left"><th>acquireCriteria</th><td>'1'</td></tr><tr
valign="top"
align="left"><th>URL4</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest'</td></tr><tr
valign="top"
align="left"><th>URL5</th><td>'http://msk-115-70.mskcc.org:8080'</td></tr><tr
valign="top"
align="left"><th>URL2</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training'</td></tr><tr
valign="top" align="left"><th>field_id</th><td>'TrainingTopic'</td></tr><tr
valign="top"
align="left"><th>tree-s</th><td>'eJzTiFZ3hILgvHRb9VgdTQAw1QTx'</td></tr><tr
valign="top"
align="left"><th>URL</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_editTopic'</td></tr><tr
valign="top" align="left"><th>topic_editTopic</th><td>'Change'</td></tr><tr
valign="top" align="left"><th>description</th><td>'This topic should provide
a listing of all training-related documents'</td></tr><tr valign="top"
align="left"><th>title</th><td>'Training Documents'</td></tr><tr
valign="top"
align="left"><th>BASE0</th><td>'http://msk-115-70.mskcc.org:8080'</td></tr><tr
valign="top"
align="left"><th>tutorialExamplesURL</th><td>'http://msk-115-70.mskcc.org:8080/MyZopeTutorial/examples'</td></tr><tr
valign="top" align="left"><th>filtered_actions</th><td>{'workflow': [],
'user': [{'permissions': ('View',), 'id': 'preferences', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/personalize_form',
'name': 'Preferences', 'visible': 1, 'category': 'user'}, {'permissions':
('View',), 'id': 'logout', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/logout', 'name': 'Log
out', 'visible': 1, 'category': 'user'}, {'permissions': ('View',), 'id':
'addFavorite', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/addtoFavorites',
'name': 'Add to favorites', 'visible': 1, 'category': 'user'},
{'permissions': ('View',), 'id': 'mystuff', 'url':
'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Members/admin/folder_contents',
'name': 'My stuff', 'visible': 1, 'category': 'user'}], 'object':
[{'permissions': ('View',), 'visible': 1, 'id': 'view', 'url':
'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_view',
'name': 'View', 'action': 'topic_view', 'category': 'object'},
{'permissions': ('Change portal topics',), 'visible': 1, 'id': 'edit',
'url':
'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_edit_form',
'name': 'Edit', 'action': 'topic_edit_form', 'category': 'object'},
{'permissions': ('Change portal topics',), 'visible': 1, 'id': 'criteria',
'url':
'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_criteria_form',
'name': 'Criteria', 'action': 'topic_criteria_form', 'category': 'object'},
{'permissions': ('Change portal topics',), 'visible': 1, 'id': 'subtopics',
'url':
'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_subtopics_form',
'name': 'Subtopics', 'action': 'topic_subtopics_form', 'category':
'object'}], 'folder': [{'permissions': ('List folder contents',), 'id':
'folderContents', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/folder_contents',
'name': 'Folder contents', 'visible': 1, 'category': 'folder'},
{'permissions': ('Manage properties',), 'id': 'syndication', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/synPropertiesForm',
'name': 'Syndication', 'visible': 1, 'category': 'folder'}], 'global':
[{'permissions': ('List undoable changes',), 'id': 'undo', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/undo_form', 'name':
'Undo', 'visible': 1, 'category': 'global'}, {'permissions': ('Manage
portal',), 'id': 'configPortal', 'url': '
http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/reconfig_form', 'name':
'Reconfigure Portal', 'visible': 1, 'category': 'global'}]}</td></tr><tr
valign="top"
align="left"><th>URL0</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_editTopic</td></tr><tr
valign="top"
align="left"><th>URL1</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360</td></tr><tr
valign="top"
align="left"><th>URL2</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training</td></tr><tr
valign="top"
align="left"><th>URL3</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest</td></tr><tr
valign="top"
align="left"><th>URL4</th><td>http://msk-115-70.mskcc.org:8080/PloneTest</td></tr><tr
valign="top"
align="left"><th>URL5</th><td>http://msk-115-70.mskcc.org:8080</td></tr><tr
valign="top"
align="left"><th>BASE0</th><td>http://msk-115-70.mskcc.org:8080</td></tr><tr
valign="top"
align="left"><th>BASE1</th><td>http://msk-115-70.mskcc.org:8080</td></tr><tr
valign="top"
align="left"><th>BASE2</th><td>http://msk-115-70.mskcc.org:8080/PloneTest</td></tr><tr
valign="top"
align="left"><th>BASE3</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest</td></tr><tr
valign="top"
align="left"><th>BASE4</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training</td></tr><tr
valign="top"
align="left"><th>BASE5</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360</td></tr><tr
valign="top"
align="left"><th>BASE6</th><td>http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_editTopic</td></tr></table><h3>environ</h3><table><tr
valign="top" align="left"><th>HTTP_ACCEPT_ENCODING</th><td>'gzip,
deflate'</td></tr><tr valign="top"
align="left"><th>CONTENT_TYPE</th><td>'application/x-www-form-urlencoded'</td></tr><tr
valign="top"
align="left"><th>PATH_TRANSLATED</th><td>'/PloneTest/ploneTest/Training/Topic,2002-04-05,1018018238740620360'</td></tr><tr
valign="top" align="left"><th>HTTP_ACCEPT</th><td>'application/vnd.ms-excel,
application/msword, application/vnd.ms-powerpoint, image/gif,
image/x-xbitmap, image/jpeg, image/pjpeg, */*'</td></tr><tr valign="top"
align="left"><th>HTTP_COOKIE</th><td>'tree-s="eJzTiFZ3hILgvHRb9VgdTQAw1QTx";
GUID=D27AA0C8A86911D3A96708C75D38AF;
SITESERVER=ID=2562f22b4c6e85957f05d0d4920dc20a;
tutorialExamplesURL="http://msk-115-70.mskcc.org:8080/MyZopeTutorial/examples";
dtpref_rows="20"; dtpref_cols="65";
tree-s="eJyLjlZ3hANPW3UdhWiEiG-RCYaIha16LBgAALPgD1c";
_ZopeId="68777676A0PgCXUB39U"'</td></tr><tr valign="top"
align="left"><th>HTTP_ACCEPT_LANGUAGE</th><td>'en-us'</td></tr><tr
valign="top"
align="left"><th>GATEWAY_INTERFACE</th><td>'CGI/1.1'</td></tr><tr
valign="top" align="left"><th>SERVER_PORT</th><td>'8080'</td></tr><tr
valign="top" align="left"><th>HTTP_USER_AGENT</th><td>'Mozilla/4.0
(compatible; MSIE 5.5; Windows NT 4.0; T312461)'</td></tr><tr valign="top"
align="left"><th>CONTENT_LENGTH</th><td>'218'</td></tr><tr valign="top"
align="left"><th>REMOTE_ADDR</th><td>'140.163.115.184'</td></tr><tr
valign="top"
align="left"><th>channel.creation_time</th><td>1018018158</td></tr><tr
valign="top"
align="left"><th>SERVER_PROTOCOL</th><td>'HTTP/1.1'</td></tr><tr
valign="top"
align="left"><th>PATH_INFO</th><td>'/PloneTest/ploneTest/Training/Topic,2002-04-05,1018018238740620360'</td></tr><tr
valign="top"
align="left"><th>HTTP_HOST</th><td>'msk-115-70.mskcc.org:8080'</td></tr><tr
valign="top" align="left"><th>REQUEST_METHOD</th><td>'POST'</td></tr><tr
valign="top" align="left"><th>SCRIPT_NAME</th><td>''</td></tr><tr
valign="top" align="left"><th>SERVER_SOFTWARE</th><td>'Zope/(Zope 2.5.0
(source release, python 2.1, linux2), python 2.1.2, darwin5)
ZServer/1.1b1'</td></tr><tr valign="top"
align="left"><th>HTTP_CACHE_CONTROL</th><td>'no-cache'</td></tr><tr
valign="top"
align="left"><th>CONNECTION_TYPE</th><td>'Keep-Alive'</td></tr><tr
valign="top"
align="left"><th>HTTP_REFERER</th><td>'http://msk-115-70.mskcc.org:8080/PloneTest/ploneTest/Training/Topic%2C2002-04-05%2C1018018238740620360/topic_edit_form'</td></tr><tr
valign="top"
align="left"><th>SERVER_NAME</th><td>'msk-115-70.mskcc.org'</td></tr></table>,
ZServerHTTPResponse(''), '1', 'TrainingTopic', 'Training Documents', 'This
topic should provide a listing of all training-related documents'), {},
(None, None)))
File Script (Python), line 17, in topic_editTopic
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/OFS/CopySupport.py,
line 215, in manage_renameObjects
(Object: ploneTest)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/OFS/CopySupport.py,
line 227, in manage_renameObject
(Object: ploneTest)
File
/Users/peterher/Documents/Downloads/Zope-2.5.0-src/lib/python/OFS/ObjectManager.py,
line 215, in _getOb
(Object: ploneTest)
AttributeError: Topic,2002-04-05,1018018238740620360
I don't know if this makes any difference, but I had been using Plone
0.9.9r6 previously. In "upgrading", I deleted my (only) Plone site, shut
down Zope, removed the old CMFPlone, and installed the new CMFPlone. I
restarted Zope, created a new Plone site, and here we are. Out of
curiosity, would it be better for me to delete the existing Plone product in
ZMI/Control Panel/Products before removing old/installing new Plone?
System config: Zope 2.5.0, CMF-1.3b1, Mac OS X 10.1.3
Other info: I just tried to add another Topic, but this time did NOT change
the ID. I suspect that this is the root of the problem -- there is a bug
somewhere in changing the ID during initial creation.
More info: The bug is not during initial creation, it recurs every time I
try to change the ID -- during creation, and afterwards.
Even more info: I think I pinpointed the bug. In performing the rename,
the manage_renameObject method of CopySupport is calling ObjectManager's
_getOb method.
Here is the body of the method:
def _getOb(self, id, default=_marker):
# FIXME: what we really need to do here is ensure that only
# sub-items are returned. That could have a measurable hit
# on performance as things are currently implemented, so for
# the moment we just make sure not to expose private attrs.
if id[:1] != '_' and hasattr(aq_base(self), id):
return getattr(self, id)
if default is _marker:
raise AttributeError, id
return default
Above and beyond the blatantly obvious "FIXME" comment, I noticed that this
method raises the AttributeError I received if the method is called without
passing in a value for the variable "default".
The funky part is, CopyObject overloads the _getOb method. Here is the
method call in manage_renameObject:
ob=self._getOb(id)
And here is CopyObject's overload of _getOb (with surrounding context):
# The following three methods should be overridden to store sub-objects
# as non-attributes.
def _setOb(self, id, object): setattr(self, id, object)
def _delOb(self, id): delattr(self, id)
def _getOb(self, id, default=_marker):
self = aq_base(self)
if default is _marker: return getattr(self, id)
try: return getattr(self, id)
except: return default
Now here's the $64K question: Why is CopySupport.manage_renameObject
calling ObjectManager._getOb rather than its own?
I have confirmed that the _getOb being called is indeed the one in
ObjectManager -- I added a 3rd argument (a string) to ObjectManager's "raise
AttributeError, id" statement, and got a nice TypeError -- but I don't
understand why. CopySupport has overloaded the method, so why isn't that
method being called?
Is the bug in Plone, CMF, or (as it seems) Zope?
The bug does not occur in CMF. CMF does not allow ID to be changed
alongside the rest of the Topic.
The bug also does not occur when changing a Plone Document. I have not
tested the other Plone types, only Topic (my original point of interest) and
Document (for comparison).
Can someone enlighten me as to what is happening?
Thanks in advance,
---Peter
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com