diff --git a/product/ERP5Type/Core/Folder.py b/product/ERP5Type/Core/Folder.py index 6479658cc64272852138485d341fd071e311f155..fc526e04fbdcc40ab3fa292cc6e64762626fc93b 100644 --- a/product/ERP5Type/Core/Folder.py +++ b/product/ERP5Type/Core/Folder.py @@ -746,21 +746,27 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, else: return CMFBTreeFolder._checkObjectId(self, id) - def objectIds(self, spec=None, base_id=None): + def objectIds(self, spec=None, **kw): if self._folder_handler == HBTREE_HANDLER: if self._htree is None: return [] - return CMFHBTreeFolder.objectIds(self, base_id) + if kw.has_key("base_id"): + return CMFHBTreeFolder.objectIds(self, base_id=kw["base_id"]) + else: + return CMFHBTreeFolder.objectIds(self) else: if self._tree is None: return [] return CMFBTreeFolder.objectIds(self, spec) - def objectItems(self, spec=None, base_id=None): + def objectItems(self, **kw): if self._folder_handler == HBTREE_HANDLER: if self._htree is None: return [] - return CMFHBTreeFolder.objectItems(self, base_id) + if kw.has_key("base_id"): + return CMFHBTreeFolder.objectItems(self, base_id=kw["base_id"]) + else: + return CMFHBTreeFolder.objectItems(self) else: if self._tree is None: return [] @@ -1352,8 +1358,8 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, security.declareProtected( Permissions.AccessContentsInformation, 'objectValues' ) def objectValues(self, spec=None, meta_type=None, portal_type=None, - sort_on=None, sort_order=None, base_id=None, - checked_permission=None, **kw): + sort_on=None, sort_order=None, checked_permission=None, + **kw): # Returns list of objects contained in this folder. # (no docstring to prevent publishing) @@ -1372,7 +1378,10 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, if self._htree is None: object_list = [] else: - object_list = CMFHBTreeFolder.objectValues(self, base_id=base_id) + if kw.has_key("base_id"): + object_list = CMFHBTreeFolder.objectValues(self, base_id=kw['base_id']) + else: + object_list = CMFHBTreeFolder.objectValues(self) else: if self._tree is None: object_list = [] diff --git a/product/ERP5Type/tests/testFolderMigration.py b/product/ERP5Type/tests/testFolderMigration.py index 1b7ce0c483722375bee737ba76691427a4d83345..0b4e373c11815149cd68beba72cedf84399459eb 100755 --- a/product/ERP5Type/tests/testFolderMigration.py +++ b/product/ERP5Type/tests/testFolderMigration.py @@ -114,7 +114,13 @@ class TestFolderMigration(ERP5TypeTestCase, LogInterceptor): self.assertEqual(self.folder.isBTree(), False) self.assertEqual(self.folder.isHBTree(), True) self.assertEqual(len(self.folder.getTreeIdList()), 1) - self.assertEqual(len(self.folder.objectIds()), 3) + self.assertEqual(len(self.folder.objectIds()), 3) + # check params of objectIds in case of hbtree + self.assertEqual(len(self.folder.objectIds(base_id=None)), 0) + LOG("test", 300, "rien") + self.assertEqual(len(self.folder.objectValues()), 3) + LOG("test", 300, "base_id") + self.assertEqual(len(self.folder.objectValues(base_id=None)), 0) # check object ids from DateTime import DateTime date = DateTime().Date()