manage_pasteObjects() requires the result of the manage_copyObjects() call as
parameter.

-aj

Maarten Nieber wrote
> 
> Hi,
> 
> I need to replace a document that has content type Section with another 
> document that has content type SectionMarketing. My approach is to simply
> move
> the folder contents from the old instance to the new instance, using these 
> lines:
> 
>             ids = [item.id for item in section.listFolderContents()]
>             section.manage_cutObjects(ids)
>             marketingsection.manage_pasteObjects()
> 
> and then replace the old instance with the new instance in my tree
> structure.
> The call to manage_pasteObjects triggers an error: "No clipboard data
> found." 
> (packed inside an HTML formatted error message). 
> 
> Can somebody point out what I'm doing wrong?
> Thanks!
> Maarten
> 
> 
> ps My entire upgrade function is
> 
> def upgrade_16_to_17b(setup):
>     catalog = getToolByName(setup, 'portal_catalog')
>     brains = catalog(object_provides=IMarketingContainer.__identifier__)
> 
>     for brain in brains:
>         container = brain.getObject()
>         sections = container.listFolderContents()
>         for section in sections:
>             id = section.id + '_marketing'
>             container.invokeFactory('abb.types.sectionmarketing', id, 
> title=section.title + '_marketing')
>             marketingsection = container[id]
>             ids = [item.id for item in section.listFolderContents()]
>             section.manage_cutObjects(ids)
>             marketingsection.manage_pasteObjects()
>             container.manage_delObjects(section.id)
> 
> _______________________________________________
> Product-Developers mailing list
> [email protected]
> https://lists.plone.org/mailman/listinfo/plone-product-developers
> 


--
View this message in context: 
http://plone.293351.n2.nabble.com/Crash-while-moving-folder-contents-tp7055262p7055420.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to