Commit 1e48f25f authored by Sebastien Robin's avatar Sebastien Robin

corrected bug recently introduced, some cells were not uncatalogued


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1306 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81235f03
...@@ -264,25 +264,33 @@ class XMLMatrix(Folder): ...@@ -264,25 +264,33 @@ class XMLMatrix(Folder):
# We may want to keep the cell, but only if we are sure # We may want to keep the cell, but only if we are sure
# the movement dictionnary will not define a new cell with this id # the movement dictionnary will not define a new cell with this id
new_object_id_list = []
if not to_delete and not (None in object_place): if not to_delete and not (None in object_place):
o = self._getOb('temp_' + object_id) o = self._getOb('temp_' + object_id)
new_name = base_id + '_' + join(object_place,'_') new_name = base_id + '_' + join(object_place,'_')
o.id = new_name o.id = new_name
new_object_id_list.extend(new_name)
#LOG("Set2 Object",0, str(new_name)) #LOG("Set2 Object",0, str(new_name))
self._setObject(new_name,o) self._setObject(new_name,o)
#LOG("Del2 Object",0, 'temp_' + str(object_id)) #LOG("Del2 Object",0, 'temp_' + str(object_id))
self._delObject('temp_' + object_id) # In all cases, we have to remove the temp object self._delObject('temp_' + object_id) # In all cases, we have to remove the temp object
o.isIndexable = 1 # reindexing is possible again o.isIndexable = 1 # reindexing is possible again
if new_name != object_id:
# Theses two lines are very important, if the object is renamed
# then we must uncatalog the previous one
o.unindexObject(path='%s/%s' % (self.getUrl() , object_id))
o.reindexObject() # we reindex in case position has changed - uid should be consistent o.reindexObject() # we reindex in case position has changed - uid should be consistent
LOG('XMLMatrix', 0, 'reindex object uid %s' % repr(o.getUid())) LOG('XMLMatrix', 0, 'reindex object uid %s' % repr(o.getUid()))
else: else:
o = self._getOb('temp_' + object_id) o = self._getOb('temp_' + object_id)
o.isIndexable = 1
# In all cases, we have to remove the temp object # In all cases, we have to remove the temp object
LOG("Del2 Object",0, 'temp_' + str(object_id)) LOG("Del2 Object",0, 'temp_' + str(object_id))
LOG("Del2 Object",0, str(o.uid)) LOG("Del2 Object",0, str(o.uid))
#ATTENTION -> if path is not good, it will not be able to uncatalog !!!!!!! #ATTENTION -> if path is not good, it will not be able to uncatalog !!!!!!!
#o.immediateReindexObject() # STILL A PROBLEM -> getUidForPath XXXXXXXXXXx #o.immediateReindexObject() # STILL A PROBLEM -> getUidForPath XXXXXXXXXXx
if object_id not in new_object_id_list: # do not unindex a new object
o.isIndexable = 1
o.unindexObject(path='%s/%s' % (self.getUrl() , object_id)) o.unindexObject(path='%s/%s' % (self.getUrl() , object_id))
o.isIndexable = 0 # unindexed already forced o.isIndexable = 0 # unindexed already forced
self._delObject('temp_' + object_id) # object will be removed from catalog automaticaly self._delObject('temp_' + object_id) # object will be removed from catalog automaticaly
......
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