Skip to content

Create parent of the correct type if the parent is missing - #275

Merged
pbauer merged 2 commits into
mainfrom
139-fix-parent-type
Feb 12, 2026
Merged

Create parent of the correct type if the parent is missing #275
pbauer merged 2 commits into
mainfrom
139-fix-parent-type

Conversation

@pbauer

@pbauer pbauer commented Dec 19, 2025

Copy link
Copy Markdown
Member

Fix #139

Comment thread src/collective/exportimport/import_content.py Outdated

@gforcada gforcada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I was planning to work on that, but you beat and very much did all I was thinking I would do if I had enough time 🤩

I mention a few nitpicks, but it's ready to be merged IMHO.

Nice!! 🌟

title=item["parent"]["title"],
)
except InvalidParameterError:
logger.info("Cannot add %s notin %r. Fallback to %s", parent_type, container, container_type, exc_info=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.info("Cannot add %s notin %r. Fallback to %s", parent_type, container, container_type, exc_info=True)
logger.info("Cannot add %s in %r. Fallback to %s", parent_type, container, container_type, exc_info=True)

@@ -463,7 +521,7 @@ def test_import_content_from_other_plone_site(self):
self.assertIn("folder1", portal.contentIds())
new_folder = portal["folder1"]
# The auto generated folder will have its id as title

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few comments that should be amended like this one

Co-authored-by: Maurits van Rees <maurits@vanrees.org>
@pbauer
pbauer merged commit c9480fa into main Feb 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parent containers always created as Folder rather than the related @type as defined in parent

3 participants