[Zope-dev] bug in manage_pasteObjects ??

Romain Slootmaekers romain at zzict.com
Thu Aug 28 23:14:12 EDT 2003


hi,


after an object is copied & paste, the following method is called:


def manage_afterClone(self, item):
     """
     """




as it happens, both self and item refer to the same object.... which 
severely limits the use of the method. You probably want a reference to 
the original object from which this one was cloned.

I googled and found a mail with the same remarks posted in 1999:
http://mail.python.org/pipermail/zope-dev/1999-November/002303.html

from which I copy the relevant part for your convenience:

<--------------- c &amp; p ----------------------->
In lib/OFS/CopySupport.py
In the function manage_pasteObjects
the following line appears:

                 ob=ob._getCopy(self)
                 ob.manage_afterClone(ob)

Passing ob as an argument doesn't make sense
because the function is being called on ob,
(so self is already ob)
it would make more sense to to something along the lines of:
		original_ob=ob
                 ob=ob._getCopy(self)
                 ob.manage_afterClone(original_ob)

</--------------- c &amp; p ----------------------->

but there's no follow- up, no reply, no fix. :(

Romain Slootmaekers







More information about the Zope-Dev mailing list