Commit 19b70e35 authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed reindexing bug and title disappearing bugf


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@263 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6b051d3
......@@ -108,7 +108,7 @@ class FolderMixIn(ExtensionClass.Base):
my_id = 1
while self.hasContent(str(my_id)):
my_id = my_id + 1
self.setLastId(str(my_id))
self._setLastId(str(my_id)) # Make sure no reindexing happens
else:
my_id = self.portal_ids.generateNewId(id_group=id_group,default=default,method=method)
......@@ -246,21 +246,22 @@ be a problem)."""
_edit = Base._edit
# Implementation
security.declarePrivate('_setObject')
def _setObject(self, id, object, roles=None, user=None, set_owner=1):
"""
This method is here in order to dynamically update old
folders into the new BTree folder type.
This method is destructive in the sens that objects
of the old folder will be lost during the update
"""
# First make sur the folder has been initialized
if not hasattr(self, '_tree'):
CMFBTreeFolder.__init__(self, self.id)
if not self._tree:
CMFBTreeFolder.__init__(self, self.id)
# Then insert the object
CMFBTreeFolder._setObject(self, id, object, roles=roles, user=user, set_owner=set_owner)
# security.declarePrivate('_setObject')
# def _setObject(self, id, object, roles=None, user=None, set_owner=1):
# """
# This method is here in order to dynamically update old
# folders into the new BTree folder type.
# This method is destructive in the sens that objects
# of the old folder will be lost during the update
# """
# # First make sur the folder has been initialized
# if not hasattr(self, '_tree'):
# CMFBTreeFolder.__init__(self, self.id)
# if not self._tree:
# CMFBTreeFolder.__init__(self, self.id)
# # Then insert the object
# CMFBTreeFolder._setObject(self, id, object, roles=roles, user=user, set_owner=set_owner)
# This method destroys the title when we create new object in empty folder
security.declareProtected(Permissions.View, 'hasContent')
def hasContent(self,id):
......
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