Commit 25d98431 authored by Alexandre Boeglin's avatar Alexandre Boeglin

manage_afterClone assumed that '__cp' is always passed in the REQUEST. Fixed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1929 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 050ccd5f
...@@ -188,8 +188,10 @@ class CopyContainer: ...@@ -188,8 +188,10 @@ class CopyContainer:
self.notifyWorkflowCreated() self.notifyWorkflowCreated()
# Add info about copy to edit workflow # Add info about copy to edit workflow
REQUEST = get_request()
if REQUEST.get('__cp', None) :
pw = self.restrictedTraverse("portal_workflow") pw = self.restrictedTraverse("portal_workflow")
copied_item_list = _cb_decode(get_request()['__cp'])[1] copied_item_list = _cb_decode(REQUEST['__cp'])[1]
# Guess source item # Guess source item
for c_item in copied_item_list: for c_item in copied_item_list:
if c_item[-1] in item.getId(): if c_item[-1] in item.getId():
...@@ -201,6 +203,12 @@ class CopyContainer: ...@@ -201,6 +203,12 @@ class CopyContainer:
pw.doActionFor(self_base, 'copy', wf_id='edit_workflow', comment='Object copied from %s' % source_item) pw.doActionFor(self_base, 'copy', wf_id='edit_workflow', comment='Object copied from %s' % source_item)
except : except :
LOG('manage_afterPaste :', 0, '''Impossible to call transition 'copy' of 'edit_workflow' for %s''' % self.getRelativeUrl()) LOG('manage_afterPaste :', 0, '''Impossible to call transition 'copy' of 'edit_workflow' for %s''' % self.getRelativeUrl())
else :
try :
pw.doActionFor(self_base, 'copy', wf_id='edit_workflow', comment='Object copied as %s' % item.getId())
except :
LOG('manage_afterPaste :', 0, '''Impossible to call transition 'copy' of 'edit_workflow' for %s''' % self.getRelativeUrl())
self.__recurse('manage_afterClone', item) self.__recurse('manage_afterClone', item)
# Reindex object # Reindex object
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment