Commit 9b96a998 authored by Julien Muchembled's avatar Julien Muchembled

Fix creation of portal_types & portal_property_sheets

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43530 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bd8ae19a
......@@ -76,8 +76,7 @@ class BaseTool (UniqueObject, Folder):
if container_path:
id_set = set(x[:-4] for x in files if x[-4:] == '.xml')
else:
id_set = set(quote(x) for x in content_id_list)
id_set.difference_update(quote(x) for x in self.objectIds())
id_set = set(quote(x) for x in content_id_list if not self.has_key(x))
dirs[:] = id_set.intersection(dirs)
for file in id_set:
load(os.path.join(root, file + '.xml'),
......
......@@ -128,6 +128,9 @@ class TypesTool(TypeProvider):
'Standard Property',
'Acquired Property',
'Dummy Class Tool',
# the following ones are required by '_migrateToPortalTypeClass'
'Types Tool',
'Property Sheet Tool',
# the following ones are required to upgrade an existing site
'Category Property',
))
......
......@@ -441,6 +441,10 @@ def synchronizeDynamicModules(context, force=False):
tool_id = tool_class.id
tool = getattr(portal, tool_id, None)
if tool is None:
# Create a "non-migrated" (types) tool, so that
# ERP5Site.migrateToPortalTypeClass doesn't think there nothing to do.
# On the other hand, we must make sure TypesTool._bootstrap installs
# the needed portal types in order to migrate this bootstrap tool.
tool = tool_class()
try:
portal._setObject(tool_id, tool, set_owner=False, suppress_events=True)
......
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