From c8aca9fe40a4fe2558a22fc314b4a487cfbfbd4b Mon Sep 17 00:00:00 2001 From: Julien Muchembled <jm@nexedi.com> Date: Mon, 21 Feb 2011 07:22:06 +0000 Subject: [PATCH] On Zope 2.8, ObjectManager._setObject doesn't know 'suppress_events' git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43508 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/dynamic/portal_type_class.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/product/ERP5Type/dynamic/portal_type_class.py b/product/ERP5Type/dynamic/portal_type_class.py index f597b1085f..83ca9d4c02 100644 --- a/product/ERP5Type/dynamic/portal_type_class.py +++ b/product/ERP5Type/dynamic/portal_type_class.py @@ -411,14 +411,16 @@ def _maybe_bootstrap(portal): tool_id = tool_class.id tool = getattr(portal, tool_id, None) if tool is None: - portal._setObject(tool_id, tool_class(), - set_owner=False, suppress_events=True) + tool = tool_class() + try: + portal._setObject(tool_id, tool, set_owner=False, suppress_events=True) + except TypeError: + portal._setObject(tool_id, tool, set_owner=False) tool = getattr(portal, tool_id) elif not tool._isBootstrapRequired(): continue if not bootstrap: - migrate = True LOG('ERP5Site', INFO, 'bootstrap %s...' % tool_id) from Products.ERP5.ERP5Site import getBootstrapDirectory bootstrap = getBootstrapDirectory() -- 2.30.9