Feed on
Posts
Comments

For a Plone portal I needed to restore a deleted folder. The deleted folder was not found in the undo tab, so I decided to use Zope import/export functionality with the binary ZEXP format. I exported a ZEXP file from a back-up using the import/export tab in the ZMI. On the Plone instance I imported the ZEXP export to restore the folder.

This was not a good solution for restoring specific items because the version history was broken/corrupt for all items. Saving an item that was restored the following exception was shown: “ArchivistUnregisteredError: The object …“. When accessing the history this error was shown “AttributeError: ‘list’ object has no attribute ‘getLength’“.

The solution was resetting the version history using the CMFEditions tool. You can reset the version history for an item this way:

hist = getToolByName(context, 'portal_archivist')
prepared =  hist.prepare(obj)
hist.register(prepared)

This solved the ArchivistUnregisteredError for me.

Trackback URI | Comments RSS

Leave a Reply