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
Pipeline #39152 failed with stage
in 0 seconds
......@@ -889,10 +889,13 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
"""
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.
"""
if deferred:
# No need to wrap
return object_value_list
portal = self.getPortalObject()
user_set = set()
......
......@@ -671,7 +671,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return []
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.
......@@ -690,6 +690,7 @@ class ZCatalog(Folder, Persistent, Implicit):
"""Catalog a list of objects.
"""
catalog = self.getSQLCatalog(sql_catalog_id)
deferred = kw.get('deferred', False)
hot_reindexing = (self.hot_reindexing_state is not None) and \
(catalog is not None) and \
(self.source_sql_catalog_id == catalog.id)
......@@ -791,6 +792,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList(
object_value_list=d['obj'],
catalog_value=destination_catalog,
deferred=deferred,
),
**kw
)
......@@ -801,6 +803,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList(
object_value_list=d['obj'],
catalog_value=archive_catalog,
deferred=deferred,
),
**kw
)
......@@ -815,6 +818,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList(
object_value_list=current_catalog_object_list,
catalog_value=catalog,
deferred=deferred,
),
**kw
)
......@@ -828,6 +832,7 @@ class ZCatalog(Folder, Persistent, Implicit):
self.wrapObjectList(
object_value_list=object_set,
catalog_value=destination_catalog,
deferred=deferred,
),
**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