[ZCM] [ZC] 1028/ 5 Comment "manage_afterClone called with wrong
parameter"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon Aug 8 06:11:15 EDT 2005
Issue #1028 Update (Comment) "manage_afterClone called with wrong parameter"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1028
==============================================================
= Comment - Entry #5 by efge on Aug 8, 2005 6:11 am
Please discuss this on the zope-dev at zope.org mailing-list.
________________________________________
= Comment - Entry #4 by bmathieu on Aug 8, 2005 6:08 am
Currently the method defined in SimpleItem.py has no docstring. In this bug, the method is called with the object itself as parameter.
In manager_afterClone defined in ObjectManager, the new container calls manage_afterClone on its subobjects with itself as 'item' parameter.
>From what I understand, we have no way in Zope to know from which object we've been cloned.
I have seen a workaround with Archetypes based contents: when entering manage_afterAdd after a copy, the UID has not yet been updated, so it is possible to find the source object. But this method is bit weak.
If making the change breaks the API, maybe the API can completed? A real manage_afterClone is missing, workarounds are not a solution.
________________________________________
= Comment - Entry #3 by efge on Jul 11, 2005 12:36 pm
That's the historic API and for good or bad we can't change it.
If you feel the docstring should be updated, please provide one.
________________________________________
= Comment - Entry #2 by bmathieu on Jul 11, 2005 9:08 am
As of Zope 2.7 and 2.8 this code in CopySupport has not changed. So, is this a bug or the expected behaviour/use case?
If yes, some documentation or comment would be welcome, since the benefit of calling manage_afterClone on an object with itself passed in parameter instead of the original object is a bit obscure...
________________________________________
= Request - Entry #1 by evilsloot on Aug 28, 2003 9:16 pm
Uploaded: "CopySupport.py"
- http://www.zope.org/Collectors/Zope/1028/CopySupport.py/view
when copying an object in Zope, the manage_afterClone method is called on the new object with the new object as a parameter. the parameter in question should be a reference to the old object. The culprit is manage_pasteObjects in lib/python/OFS/CopySupport.py
a corrected version of the file (changing lines 158-170) was uploaded with this report.
==============================================================
More information about the Zope-Collector-Monitor
mailing list