During the clear in SQLCatalog, not create of 'reserved' element if there is a portal ids

In hot reindexing during the 'double indexing' step, update the security
of object in the destination catalog too


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32501 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f339626
......@@ -728,7 +728,19 @@ class Catalog(Folder,
def getSecurityUid(self, wrapped_object):
"""
Cache a uid for each security permission
Return a tuple with a security uid (string) and a new tuple content the
roles and users if not exist already.
With the roles of object, search the security_uid associate in the
catalog_innodb:
- if the security not exist a security uid is generated with id_tool
or security_uid_index property and
return the new security_uid and the tuple contains the new roles
to add the roles in roles_and_user table of the database.
- if the security exist the security uid is returned and the second
element is None for not recreate the security in roles_and_user
table of the database.
We try to create a unique security (to reduce number of lines)
and to assign security only to root document
"""
......@@ -797,8 +809,10 @@ class Catalog(Folder,
# Reserved uids have been removed.
self.clearReserved()
# Add a dummy item so that SQLCatalog will not use existing uids again.
self.insertMaxUid()
id_tool = getattr(self.getPortalObject(), 'portal_ids', None)
if id_tool is None:
# Add a dummy item so that SQLCatalog will not use existing uids again.
self.insertMaxUid()
# Remove the cache of catalog schema.
if hasattr(self, '_v_catalog_schema_dict') :
......
......@@ -393,10 +393,12 @@ class ZCatalog(Folder, Persistent, Implicit):
"""
if self.default_sql_catalog_id == source_sql_catalog_id:
self.default_sql_catalog_id = destination_sql_catalog_id
# Insert the latest generated uid.
# This must be done just before swaping the catalogs in case there were
# generated uids since destination catalog was created.
self[destination_sql_catalog_id].insertMaxUid()
id_tool = getattr(self.getPortalObject(), 'portal_ids', None)
if id_tool is None:
# Insert the latest generated uid.
# This must be done just before swaping the catalogs in case there were
# generated uids since destination catalog was created.
self[destination_sql_catalog_id].insertMaxUid()
LOG('exchangeDatabases skin_selection_dict:',0,skin_selection_dict)
if skin_selection_dict is not None:
......@@ -836,8 +838,12 @@ class ZCatalog(Folder, Persistent, Implicit):
if self.hot_reindexing_state == HOT_REINDEXING_RECORDING_STATE:
destination_catalog.recordObjectList(url_list, 1)
else:
if wrapped_object_list:
destination_catalog.catalogObjectList(wrapped_object_list,**kw)
wrapped_destination_object_list = []
for obj in object_list:
wrap_obj = self.wrapObject(obj, sql_catalog_id=self.destination_sql_catalog_id)
wrapped_destination_object_list.append(wrap_obj)
if wrapped_destination_object_list:
destination_catalog.catalogObjectList(wrapped_destination_object_list,**kw)
object_list[:] = failed_object_list
......
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