During our work with Pimcore we encountered the following case: an object was added to system, published, several versions were saved without publishing, then the object was unpublished - from the grid view. It was a batch action ran from the grid. The operation resulted in apparent loss of data, as the data that existed in the unsaved versions were replaced by those that existed in the latest published version. This made it in turn necessary to restore data for the several thousands overwritten objects.
I’ve got a working solution for the single edit action ran from the grid, and as of yet untested solution for the batch action. It basically consists of checking whether there is an unpublished version of the object, create a new version derived from the last unpublished version when it does, setting the data from the grid on both the database object and the copy of the unpublished version, and then saving the unpublished version after the main object is saved. It basically prevents data loss in case there are unpublished versions.
What do you think about this proposition?