RE: [Zope-dev] Something doesn't seem quite right with CopySuppor t.py/Moniker.py
I _think_ the problem is that the copy/paste machinery really needs to be called with a REQUEST so that it can verify whether the copy is allowed. Try this and let me know if you still have problems:
def candp(fobj, tobj, REQUEST): "Copy and paste"
ids = fobj.objectIds() if not ids: return cdata = fobj.manage_copyObjects(ids) tobj.manage_pasteObjects(cdata, REQUEST)
I made these changes, and modified my DTML to be: <dtml-call "candp(fobj, this(), REQUEST)">
I'm getting the same error (one or more items not found). Here's the end of the traceback... ... Files\Byproducts\lib\python\OFS\CopySupport.py, line 198, in manage_pasteObjects (Object: CatalogAware) Copy Error: (see above)
Anything else to try?
hmmm - CatalogAware? That looks strange indeed. To take a guess, it looks like the paste is failing on a ZClass instance. A way to test this would be to try your copying external method on two plain folders that contain only "builtin" objects like files or images. If the method works in that case, then I suspect something funny about one of your ZClasses. In particular, make sure that all of them list either ZObject or ZObjectManager in their list of base classes. Also, did any of the ZClasses you are copying get imported into your site from an earlier Zope version? Thanks! Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
participants (1)
-
Brian Lloyd