Environment: using buildout.coredev branch 5.1, Plone 5.1a2.dev0, plone.app.iterate 3.1.7.dev0
Steps to reproduce:
At this point if you go to the original item you'll see a message showing the item is locked. There's no way to unlock.
It happens because the right thing to do would be use the "cancel checkout" action, instead of deleting the working copy directly. However the possibility of deleting the working copy is open to the user, so it still counts as a bug.
Locally I fixed it by using the same mechanism used by plone.app.linkintegrity to prevent the deletion of referenced content items.
When the user tries to delete the working copy instead of the default confirmation pop-up a message is shown saying that the user cannot delete the working copy and pointing to the "cancel checkout" page.
Technically it means:
IWorkingCopy, IObjectRemovedEvent.IDeleteWorkingCopyError, which derived from OFS.ObjectManager.BeforeDeleteExceptionindex.html is registered for the context IDeleteWorkingCopyError. This view shows the message warning the working copy can't be deleted and offers a link to the @@content-cancel-checkout.What do you think of this approach? Should I open a pull request?
can we have the same in Plone 4?
@hvelarde I think so. If the fix is implemented on plone.app.iterate then we can backport to the branch used in Plone 4.
On a side note: The main difference on Plone 5 is that the plone.app.iterate version used there incorporates plone.app.stagingbehavior. Putting this aside, you can use the current plone.app.iterate on Plone 4.3.x and ignore plone.app.stagingbehavior I do this and it works.