Commit 4dbf2872 authored by Sebastien Robin's avatar Sebastien Robin

- Fixed some unindex problems while doing hot reindexing

- the path in uncatalog object is inconsistent.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13183 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b84e152
......@@ -1522,7 +1522,7 @@ class Catalog( Folder,
method = getattr(self, method_name)
method(uid = uid)
def uncatalogObject(self, path=None,uid=None):
def uncatalogObject(self, path=None, uid=None):
"""
Uncatalog and object from the Catalog.
......
......@@ -714,7 +714,7 @@ class ZCatalog(Folder, Persistent, Implicit):
if hot_reindexing:
destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id)
if destination_catalog.id != catalog.id:
if self.hot_reindexing_state == 'recording':
if self.hot_reindexing_state == HOT_REINDEXING_RECORDING_STATE:
destination_catalog.recordObjectList(url_list, 1)
else:
destination_catalog.catalogObjectList(wrapped_object_list,**kw)
......@@ -725,16 +725,18 @@ class ZCatalog(Folder, Persistent, Implicit):
def uncatalog_object(self, uid=None,path=None, sql_catalog_id=None):
""" wrapper around catalog """
catalog = self.getSQLCatalog(sql_catalog_id)
if uid is None:
raise TypeError, "sorry uncatalog_object supports only uid"
if catalog is not None:
catalog.uncatalogObject(uid=uid,path=path)
if self.hot_reindexing_state is not None and self.source_sql_catalog_id == catalog.id:
destination_catalog = self.getSQLCatalog(self.destination_sql_catalog_id)
if destination_catalog.id != catalog.id:
if self.hot_reindexing_state == 'recording':
if self.hot_reindexing_state == HOT_REINDEXING_RECORDING_STATE:
destination_catalog.recordObjectList([uid], 0)
else:
destination_catalog.uncatalogObject(uid)
destination_catalog.uncatalogObject(uid=uid)
def beforeUncatalogObject(self, uid=None,path=None, sql_catalog_id=None):
""" wrapper around catalog """
......
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