You are here: Home / Documentation / How To's / Workaround for "AttributeError: _cloned_object_path" error

Workaround for "AttributeError: _cloned_object_path" error

by nguyen — published Jan 27, 2012 02:44 PM, last modified Aug 16, 2016 10:50 AM
a patch, for the "AttributeError: _cloned_object_path" error

If you use the ZMI to copy and paste an object (in my case, a workflow within portal_workflows) and get the error "AttributeError: _cloned_object_path", you can apply this patch (in my case, in the ~/.buildout/eggs/Products.CMFFormController-3.0.2-py2.6.egg/Products/CMFFormController directory):

$ diff ControllerBase\ copy.py ControllerBase.py
75,80c75,81
<         cloned_object_path = getattr(self, '_cloned_object_path')
<         cloned_object = self.getPhysicalRoot().unrestrictedTraverse(cloned_object_path)
<         delattr(cloned_object, '_old_id')
<         delattr(cloned_object, '_cloned_object_path')
<         # clean up the new object
<         delattr(self, '_cloned_object_path')
---
>         cloned_object_path = getattr(self, '_cloned_object_path', None)
>         if cloned_object_path:
>             cloned_object = self.getPhysicalRoot().unrestrictedTraverse(cloned_object_path)
>             delattr(cloned_object, '_old_id')
>             delattr(cloned_object, '_cloned_object_path')
>             # clean up the new object
>             delattr(self, '_cloned_object_path')

The issue for this problem is located here: http://dev.plone.org/ticket/3875 

Navigation