From a9bafbfc805f70f82796877b15fa0edef8951eb2 Mon Sep 17 00:00:00 2001 From: David Glick Date: Wed, 11 Dec 2024 12:20:00 -0800 Subject: [PATCH] fix accidental storage with aq wrapper in migrate_base_class_to_new_class --- news/714.bugfix | 1 + plone/app/contenttypes/utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/714.bugfix diff --git a/news/714.bugfix b/news/714.bugfix new file mode 100644 index 000000000..aec0e46e8 --- /dev/null +++ b/news/714.bugfix @@ -0,0 +1 @@ +Fix migrate_base_class_to_new_class util to remove Acquisition wrappers. @davisagli diff --git a/plone/app/contenttypes/utils.py b/plone/app/contenttypes/utils.py index 1e4ccde0f..7c9aace2e 100644 --- a/plone/app/contenttypes/utils.py +++ b/plone/app/contenttypes/utils.py @@ -1,3 +1,4 @@ +from Acquisition import aq_base from plone.dexterity.interfaces import IDexterityContent from plone.dexterity.interfaces import IDexterityFTI from plone.folder.interfaces import IOrdering @@ -97,7 +98,7 @@ def migrate_base_class_to_new_class( parent = obj.__parent__ parent._delOb(obj_id) obj.__class__ = new_class - parent._setOb(obj_id, obj) + parent._setOb(obj_id, aq_base(obj)) is_container = isinstance(obj, BTreeFolder2Base)