Commit aaf2aa4a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

if a module for the old object is already removed, we cannot backup the object.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32890 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1d20b6a2
...@@ -100,8 +100,8 @@ class TrashTool(BaseTool): ...@@ -100,8 +100,8 @@ class TrashTool(BaseTool):
o = o.aq_parent o = o.aq_parent
connection=o._p_jar connection=o._p_jar
copy.seek(0) copy.seek(0)
backup = connection.importFile(copy)
try: try:
backup = connection.importFile(copy)
backup.isIndexable = ConstantGetter('isIndexable', value=False) backup.isIndexable = ConstantGetter('isIndexable', value=False)
try: try:
# the isIndexable setting above avoids the recursion of # the isIndexable setting above avoids the recursion of
...@@ -115,10 +115,11 @@ class TrashTool(BaseTool): ...@@ -115,10 +115,11 @@ class TrashTool(BaseTool):
# BACK: On Zope 2.8. _setObject does not accept "suppress_events" # BACK: On Zope 2.8. _setObject does not accept "suppress_events"
# remove when we drop support # remove when we drop support
backup_object_container._setObject(object_id, backup) backup_object_container._setObject(object_id, backup)
except AttributeError: except (AttributeError, ImportError):
# XXX we can go here due to formulator because attribute field_added # XXX we can go here due to formulator because attribute
# doesn't not exists on parent if it is a Trash Folder and not a Form # field_added doesn't not exists on parent if it is a Trash
# so object is not backup # Folder and not a Form, or a module for the old object is
# already removed, and we cannot backup the object
LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id)) LOG("Trash Tool backupObject", 100, "Can't backup object %s" %(object_id))
pass pass
......
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