Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"AT->dexterity" migration forgets to migrate "Products.CMFEditions" state attributes #565

Open
d-maurer opened this issue Aug 3, 2020 · 0 comments

Comments

@d-maurer
Copy link

d-maurer commented Aug 3, 2020

The following code from Products.CMFEditions.ArchivistTool.ArchivitTool.prepare states an invariant:

        obj, history_id = dereference(obj, zodb_hook=self)
        if storage.isRegistered(history_id):
            # already registered
            version_id = len(self.queryHistory(obj))
            is_registered = True
        else:
            # object isn't under version control yet
            # A working copy being under version control needs to have
            # a history_id, version_id (starts with 0) and a location_id
            # (the current implementation isn't able yet to handle multiple
            # locations. Nevertheless lets set the location id to a well
            # known default value)
            uidhandler = getToolByName(self, 'portal_historyidhandler')
            history_id = uidhandler.register(obj)
            version_id = obj.version_id = 0
            alsoProvides(obj, IVersioned)
            obj.location_id = 0
            is_registered = False

i.e. if an object is registered, it must have attributes location_id and version_id.

The "AT->dexterity" migration forgets to migrate those attributes. As a consequence, the migrated objects can no longer be edited (--> AttributeError: "location_id").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants