From 3921da0e0f18d2a096e5eebc351eb27cb47546ba Mon Sep 17 00:00:00 2001 From: Eric Wohnlich Date: Thu, 26 Jun 2025 10:09:47 -0400 Subject: [PATCH 1/3] Create 64.bugfix --- news/64.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/64.bugfix diff --git a/news/64.bugfix b/news/64.bugfix new file mode 100644 index 0000000..2cba933 --- /dev/null +++ b/news/64.bugfix @@ -0,0 +1 @@ +Use OS-agnostic path parser to get parent object on content import From aaef1dcd11ab3aafc9e8b44960aba924c012be9e Mon Sep 17 00:00:00 2001 From: Eric Wohnlich Date: Thu, 26 Jun 2025 10:12:01 -0400 Subject: [PATCH 2/3] Fix parent_path for Windows, etc --- src/plone/exportimport/utils/content/import_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plone/exportimport/utils/content/import_helpers.py b/src/plone/exportimport/utils/content/import_helpers.py index 7ee8f39..51c6c20 100644 --- a/src/plone/exportimport/utils/content/import_helpers.py +++ b/src/plone/exportimport/utils/content/import_helpers.py @@ -3,7 +3,7 @@ from .core import object_from_uid from Acquisition import aq_base from Acquisition import aq_parent -from pathlib import Path +from pathlib import PurePosixPath from Persistence import PersistentMapping from plone import api from plone.base.interfaces.constrains import ENABLED @@ -36,7 +36,7 @@ def get_deserializer(data: dict, request) -> Callable: def get_parent_from_item(data: dict) -> Optional[DexterityContent]: - parent_path = str(Path(data["@id"]).parent) + parent_path = str(PurePosixPath(data["@id"]).parent) if data.get("@type") == "Plone Site": parent = aq_parent(api.portal.get()) else: From 056d3030b47b867bc91af379a73ba249b47652fc Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 26 Jun 2025 11:52:56 -0600 Subject: [PATCH 3/3] Update news/64.bugfix --- news/64.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/64.bugfix b/news/64.bugfix index 2cba933..037c4f1 100644 --- a/news/64.bugfix +++ b/news/64.bugfix @@ -1 +1 @@ -Use OS-agnostic path parser to get parent object on content import +Fix error getting parent object on Windows. @ewohnlich