Commit c66dbeee authored by Vincent Pelletier's avatar Vincent Pelletier

Prevent catalog clear from failing when portal_ids table does not exist. Code...

Prevent catalog clear from failing when portal_ids table does not exist. Code structure taken from ZSQLCatalog/SQLCatalog.py:Catalog.clear() .


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17308 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d42ccc2b
......@@ -604,10 +604,19 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
Clears the catalog by calling a list of methods
"""
id_tool = self.getPortalObject().portal_ids
# Call generate new id in order to store the last id into
# the zodb
id_tool.generateNewLengthId(id_group='portal_activity')
id_tool.generateNewLengthId(id_group='portal_activity_queue')
try:
# Call generate new id in order to store the last id into
# the zodb
id_tool.generateNewLengthId(id_group='portal_activity')
id_tool.generateNewLengthId(id_group='portal_activity_queue')
except ConflictError:
raise
except:
# Swallow exceptions to allow catalog clear to happen.
# For example, is portal_ids table does not exist and exception will
# be thrown by portal_id methods.
LOG('ERP5Catalog.beforeCatalogClear', WARNING,
'beforeCatalogClear failed', error=sys.exc_info())
security.declarePrivate('unrestrictedSearchResults')
def unrestrictedSearchResults(self, REQUEST=None, **kw):
......
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