Commit 2184de3c authored by Aurel's avatar Aurel

fix condition while using archive to know if object must go in current

catalog or not


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17484 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4b0a0058
...@@ -741,6 +741,7 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -741,6 +741,7 @@ class ZCatalog(Folder, Persistent, Implicit):
url_list.append(url) url_list.append(url)
goto_current_catalog = 0 goto_current_catalog = 0
# either we are doing archiving, either we have used archive without a catalog specified
if (not disable_archive) and (archiving or (len(archive_obj_list) > 0 and sql_catalog_id is None)): if (not disable_archive) and (archiving or (len(archive_obj_list) > 0 and sql_catalog_id is None)):
# check in which archive object must go if we defined archive # check in which archive object must go if we defined archive
catalog_id = None catalog_id = None
...@@ -748,12 +749,16 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -748,12 +749,16 @@ class ZCatalog(Folder, Persistent, Implicit):
if archive.test(obj) is True: if archive.test(obj) is True:
goto_current_catalog = 0 goto_current_catalog = 0
catalog_id = archive.getCatalogId() catalog_id = archive.getCatalogId()
# if current catalog, no need to construct dict as it will be reindex now
if catalog_id in (default_catalog.id, self.source_sql_catalog_id):
goto_current_catalog = 1
continue
priority = archive.getPriority() priority = archive.getPriority()
if catalog_dict.has_key(catalog_id): if catalog_dict.has_key(catalog_id):
catalog_dict[catalog_id]['obj'].append(obj) catalog_dict[catalog_id]['obj'].append(obj)
else: else:
catalog_dict[catalog_id] = {'priority' : priority, 'obj' : [obj,]} catalog_dict[catalog_id] = {'priority' : priority, 'obj' : [obj,]}
if catalog_id is None or sql_catalog_id is None or self.source_sql_catalog_id == catalog.id: if catalog_id is None:
# at least put object in current catalog if no archive match # at least put object in current catalog if no archive match
goto_current_catalog = 1 goto_current_catalog = 1
else: else:
......
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