diff --git a/CHANGES.rst b/CHANGES.rst index 048e9d46..0d11be45 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,9 @@ Changelog 1.8 (unreleased) ---------------- -- Nothing changed yet. +- Temporarily disallow constraints when creating the parent folder chain. + (#173) + [ale-rt] 1.7 (2023-01-20) diff --git a/src/collective/exportimport/import_content.py b/src/collective/exportimport/import_content.py index 7162a616..0416a348 100644 --- a/src/collective/exportimport/import_content.py +++ b/src/collective/exportimport/import_content.py @@ -900,12 +900,19 @@ def create_container(self, item): # create original structure for imported content for element in parent_path: if element not in folder: + constraints = ISelectableConstrainTypes(folder, None) + constraints_state = constraints and constraints.getConstrainTypesMode() + if constraints_state: + constraints.setConstrainTypesMode(0) folder = api.content.create( container=folder, type="Folder", id=element, title=element, ) + if constraints and constraints_state: + constraints.setConstrainTypesMode(constraints_state) + logger.info( u"Created container {} to hold {}".format( folder.absolute_url(), item["@id"]