Skip to content

Commit 0735953

Browse files
authored
Merge pull request #268 from collective/dropped_relations
prevent existing relations from being lost
2 parents 32ae130 + dee8a75 commit 0735953

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changelog
99
[mamico]
1010
- Fixed data extraction of Archetypes ATFilefields to concatenate all `Pdata` chunks, when the FileField data was still stored in Filestorage and not not migrated to use blobstorage (using plone.app.blobs).
1111
[@jnptk]
12+
- Bugfix to prevent clearing existing relations from catalog when migrating into sites with existing content [ThibautBorn]
1213

1314
1.15 (2025-07-15)
1415
-----------------

src/collective/exportimport/import_other.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,16 @@ def import_relations(self, data):
359359
all_fixed_relations, key=itemgetter("from_uuid", "from_attribute")
360360
)
361361
if HAS_RELAPI:
362+
relapi.store_relations()
362363
relapi.purge_relations()
363364
relapi.cleanup_intids()
365+
relapi.restore_relations()
364366
relapi.restore_relations(all_relations=all_fixed_relations)
365367
elif HAS_PLONE6:
368+
relationhelper.store_relations()
366369
relationhelper.purge_relations()
367370
relationhelper.cleanup_intids()
371+
relationhelper.restore_relations()
368372
relationhelper.restore_relations(all_relations=all_fixed_relations)
369373

370374
def get_from_attribute(self, rel):

0 commit comments

Comments
 (0)