Commit 6e6eb5f0 authored by Rafael Monnerat's avatar Rafael Monnerat

ERP5Type: Include OFSFolder2._cleanup method

  This aims to add compatibility with BTreeFolder2 API, even it is not
  required. Since some checkConsistency may call self._cleanup() regardless
  expecting that the folder is a [H]BTreeFolder2 always.

  This was detected when a post upgrade constrant was included to
  portal_categories
parent 2c525e57
...@@ -667,6 +667,12 @@ class OFSFolder2(OFSFolder): ...@@ -667,6 +667,12 @@ class OFSFolder2(OFSFolder):
except AttributeError as exc: except AttributeError as exc:
raise KeyError(exc.args) raise KeyError(exc.args)
def _cleanup(self):
# Keep compatibility with BTreeFolder2 API, despite it is not reaquired.
# This api is required by the [check,fix]Consistency implementation.
LOG("OFSFolder2._cleanup", WARNING, "This folder class do not implement _cleanup, skip.")
return True
OFS_HANDLER = 0 OFS_HANDLER = 0
BTREE_HANDLER = 1 BTREE_HANDLER = 1
HBTREE_HANDLER = 2 HBTREE_HANDLER = 2
......
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