Commit f3534e8f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! fixup! erp5_full_text_mroonga_catalog: defer fulltext index and unindex using...

no need to wrap object list in case of deferred index, otherwise another security_uid
can be issued.
parent 03bb8f69
...@@ -889,10 +889,13 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -889,10 +889,13 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
""" """
return ZCatalog.countResults(self, REQUEST, **kw) return ZCatalog.countResults(self, REQUEST, **kw)
def wrapObjectList(self, object_value_list, catalog_value): def wrapObjectList(self, object_value_list, catalog_value, deferred=False):
""" """
Return a list of wrapped objects for reindexing. Return a list of wrapped objects for reindexing.
""" """
if deferred:
# No need to wrap
return object_value_list
portal = self.getPortalObject() portal = self.getPortalObject()
user_set = set() user_set = set()
......
...@@ -671,7 +671,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -671,7 +671,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return [] return []
security.declarePrivate('wrapObjectList') security.declarePrivate('wrapObjectList')
def wrapObjectList(self, object_value_list, catalog_value): def wrapObjectList(self, object_value_list, catalog_value, deferred=False):
""" """
Return a list of wrapped objects for reindexing. Return a list of wrapped objects for reindexing.
...@@ -690,6 +690,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -690,6 +690,7 @@ class ZCatalog(Folder, Persistent, Implicit):
"""Catalog a list of objects. """Catalog a list of objects.
""" """
catalog = self.getSQLCatalog(sql_catalog_id) catalog = self.getSQLCatalog(sql_catalog_id)
deferred = kw.get('deferred', False)
hot_reindexing = (self.hot_reindexing_state is not None) and \ hot_reindexing = (self.hot_reindexing_state is not None) and \
(catalog is not None) and \ (catalog is not None) and \
(self.source_sql_catalog_id == catalog.id) (self.source_sql_catalog_id == catalog.id)
...@@ -791,6 +792,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -791,6 +792,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=d['obj'], object_value_list=d['obj'],
catalog_value=destination_catalog, catalog_value=destination_catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -801,6 +803,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -801,6 +803,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=d['obj'], object_value_list=d['obj'],
catalog_value=archive_catalog, catalog_value=archive_catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -815,6 +818,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -815,6 +818,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=current_catalog_object_list, object_value_list=current_catalog_object_list,
catalog_value=catalog, catalog_value=catalog,
deferred=deferred,
), ),
**kw **kw
) )
...@@ -828,6 +832,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -828,6 +832,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList( self.wrapObjectList(
object_value_list=object_set, object_value_list=object_set,
catalog_value=destination_catalog, catalog_value=destination_catalog,
deferred=deferred,
), ),
**kw **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