Commit 4db2cc8a authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: Revert partially "ZODB Components: Fix bootstrap of migrated bt5s.".

This reverts the following part of 5d9c30e:

* Upon bt5 installation, install portal_type* items before bt5 {Document,
  Extensions...} as corresponding Portal Type are required once they have been
  migrated to ZODB Components.

This obviously does not work as the Document can be used as Type Class and
also because tool_item is required before portal_types for example (see
test_type_provider).

When bootstrapping erp5_core and installing for example an Extension
Component, this will try to load Extension Component Portal Type which does
not exist yet but fallback on its document class instead, which is enough
until Extension Component Portal Type is installed.
parent aa4f7613
...@@ -4803,12 +4803,6 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4803,12 +4803,6 @@ Business Template is a set of definitions, such as skins, portal types and categ
_item_name_list = [ _item_name_list = [
'_registered_version_priority_selection_item', '_registered_version_priority_selection_item',
'_workflow_item', '_workflow_item',
'_portal_type_item',
#'_portal_type_workflow_chain_item',
'_portal_type_allowed_content_type_item',
'_portal_type_hidden_content_type_item',
'_portal_type_property_sheet_item',
'_portal_type_base_category_item',
'_product_item', '_product_item',
'_document_item', '_document_item',
'_property_sheet_item', '_property_sheet_item',
...@@ -4819,6 +4813,12 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4819,6 +4813,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
'_tool_item', '_tool_item',
'_message_translation_item', '_message_translation_item',
'_site_property_item', '_site_property_item',
'_portal_type_item',
#'_portal_type_workflow_chain_item',
'_portal_type_allowed_content_type_item',
'_portal_type_hidden_content_type_item',
'_portal_type_property_sheet_item',
'_portal_type_base_category_item',
'_category_item', '_category_item',
'_module_item', '_module_item',
'_portal_type_roles_item', '_portal_type_roles_item',
......
...@@ -143,30 +143,17 @@ class ComponentTool(BaseTool): ...@@ -143,30 +143,17 @@ class ComponentTool(BaseTool):
LOG("ERP5Type.Tool.ComponentTool", INFO, "Resetting Components") LOG("ERP5Type.Tool.ComponentTool", INFO, "Resetting Components")
type_tool = portal.portal_types
# One Component Package per allowed Portal Types on Component Tool
allowed_content_type_list = type_tool.getTypeInfo(
self.getPortalType()).getTypeAllowedContentTypeList()
import erp5.component
# Make sure that it is not possible to load Components or load Portal Type # Make sure that it is not possible to load Components or load Portal Type
# class when Components are reset through aq_method_lock # class when Components are reset through aq_method_lock
import erp5.component
from Products.ERP5Type.dynamic.component_package import ComponentDynamicPackage
with Base.aq_method_lock: with Base.aq_method_lock:
for content_type in allowed_content_type_list: for package in erp5.component.__dict__.itervalues():
package_name = content_type.split(' ')[0].lower() if isinstance(package, ComponentDynamicPackage):
try:
package = getattr(erp5.component, package_name)
# XXX-arnau: not everything is defined yet...
except AttributeError:
pass
else:
package.reset() package.reset()
if reset_portal_type_at_transaction_boundary: if reset_portal_type_at_transaction_boundary:
type_tool.resetDynamicDocumentsOnceAtTransactionBoundary() portal.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
else: else:
from Products.ERP5Type.dynamic.portal_type_class import synchronizeDynamicModules from Products.ERP5Type.dynamic.portal_type_class import synchronizeDynamicModules
synchronizeDynamicModules(self, force) synchronizeDynamicModules(self, force)
......
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