From 3f127a966260636ff644943e9e7ff9ffabe69e88 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 3 Jan 2006 13:17:39 +0000
Subject: [PATCH] allow dublication uid if specified

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5002 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZSQLCatalog/SQLCatalog.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index 7ab52d6b9a..633277148c 100755
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -937,7 +937,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
     """
     self.catalogObjectList([object])
 
-  def catalogObjectList(self, object_list, method_id_list=None, disable_cache=0):
+  def catalogObjectList(self, object_list, method_id_list=None, disable_cache=0,
+                              allow_duplicate_uid=0):
     """
       Add objects to the Catalog by calling
       all SQL methods and providing needed arguments.
@@ -998,7 +999,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
           # Make sure no duplicates - ie. if an object with different path has same uid, we need a new uid
           # This can be very dangerous with relations stored in a category table (CMFCategory)
           # This is why we recommend completely reindexing subobjects after any change of id
-          catalog_path = self.getPathForUid(uid)
+          catalog_path = None
+          if not allow_duplicate_uid:
+            catalog_path = self.getPathForUid(uid)
           #LOG('catalogObject', 0, 'uid = %r, catalog_path = %r' % (uid, catalog_path))
           if catalog_path == "reserved":
             # Reserved line in catalog table
-- 
2.30.9