[Zope-CMF] Copy/Paste Workflow Bug?

Tres Seaver tseaver@zope.com
19 Jul 2002 12:20:01 -0400


On Thu, 2002-07-18 at 14:09, Dieter Maurer wrote:
> Sidnei da Silva writes:
>  > I was migration an old site this weekend, and after copying all the object 
>  > from the old to the new site, i noticed that most of them lost the workflow 
>  > state.
>  > 
>  > I tried to reproduce the bug, and this is what happens:
>  > 
>  >   * Cut object, paste on another folder -> workflow state is kept.
>  >   * Copy object, paste on same folder -> workflow state is lost for new 
>  > object.
>  >   * Copy object, paste on another folder -> workflow state is lost for new 
>  > object.
>  > 
>  > Alan told me that this should have been fixed a while ago, and i remeber the 
>  > thread, but i cant remember the solution.
> Tres reported that the problem has been resolved without telling how
> he did it.
> 
> But in an earlier post, he suggested to see whether there is already
> a workflow state and in this case not append a new initial state.
> Apparently, this is not the solution he finally implemented,
> because it would work for "copy/paste", too, and not only for "cut/paste".

The solution was to remove the "notify workflow of new instance" code
from 'manage_afterAdd', and put it in 'manage_afterClone';  "cut +
paste" thus no longer engages the workflow.

>  > He also mentioned that maybe 
>  > something was appending to review_workflow or workflow_history, and removing 
>  > the last item there would fix it, but i couldnt find the relation to 
>  > copy/paste.
> That's what I know from earlier CMF versions.
> I have an External Method that (quite crudely) removes the last
> state from all objects.

Copy + paste creates a new object, and does *not* carry along any
workflow history;  the object goes into the appropriate initial state
for its workflow.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com