How does the review_state get handled during move and copy?

When moving content (cut & paste) the review_state stays the same, when copying (copy & paste) it is set to the initial state. All good, that makes sense. But where (in the code) does that happen?
I have an application where moved objects are always in the initial state and I have a hard time finding out what is wrong.

afaik the review_state is derived from the workflow history.
Moving objects will not touch that, so it stays the same.

Copying objects will have to either ignore or remove it, which I think is done here: Products.CMFCore/ at 361a30e0c72a15a21f88433b8d5fc49331f36728 · zopefoundation/Products.CMFCore · GitHub

Note: I didn't actually copy an object with this code disabled, so I could be very very wrong :smiley:

1 Like

Thanks a lot that's actually the right place. When I comment that out a copy&paste obj stays published same as cut&paste.

Sadly that does not yet explain why moved items in my application are at the initial state after being moved instead of keeping the state. I'll have to investigate the state of workflow_history before and after and the actual workflows of the containers.

I would look for an event handler that is resetting the workflow history after a move. I don't think there is anything in Plone that does that unless it has been customized in your application.