Commit 09e025bd authored by Arnaud Fontaine's avatar Arnaud Fontaine

Make sure that objects created on bootstrap are committed before trying to load them from ZODB.

Because of recently added Component Tool, POSKeyError exception was raised
when trying to load it from ZODB during migration of Portal Type classes and
ZODB Property Sheets (PickleUpdater() in ERP5Site.migrateToPortalTypeClass),
so make sure that there is a commit before loading anything from ZODB.
parent 98107d18
......@@ -44,6 +44,7 @@ from zLOG import LOG, INFO, WARNING, ERROR
from string import join
import os
import warnings
import transaction
from App.config import getConfiguration
MARKER = []
......@@ -1600,6 +1601,10 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
security.declareProtected(Permissions.ManagePortal,
'migrateToPortalTypeClass')
def migrateToPortalTypeClass(self):
# PickleUpdater() will load objects from ZODB, but any objects created
# before must have been committed (otherwise POSKeyError is raised)
transaction.savepoint(optimistic=True)
from Products.ERP5Type.dynamic.persistent_migration import PickleUpdater
from Products.ERP5Type.Tool.BaseTool import BaseTool
PickleUpdater(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment