Commit 2be6d19f authored by Nicolas Dumazet's avatar Nicolas Dumazet

events only exist since Zope 2.10

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42397 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 65510366
No related merge requests found
......@@ -14,6 +14,7 @@
# Import: add rename feature and make _importObjectFromFile return the object
from OFS.ObjectManager import ObjectManager, customImporters
from App.version_txt import getZopeVersion
def ObjectManager_importObjectFromFile(self, filepath, verify=1, set_owner=1, id=None, suppress_events=False):
#LOG('_importObjectFromFile, filepath',0,filepath)
......@@ -30,7 +31,12 @@ def ObjectManager_importObjectFromFile(self, filepath, verify=1, set_owner=1, id
if id is None:
id=ob.id
if hasattr(id, 'im_func'): id=id()
self._setObject(id, ob, set_owner=set_owner, suppress_events=suppress_events)
if getZopeVersion()[1] >= 10:
# only in Zope > 2.10
self._setObject(id, ob, set_owner=set_owner, suppress_events=suppress_events)
else:
self._setObject(id, ob, set_owner=set_owner)
# try to make ownership implicit if possible in the context
# that the object was imported into.
......
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