Skip to content

Import entry parents - #20

Merged
duncanmcclean merged 5 commits into
mainfrom
import-entry-parents
Oct 31, 2024
Merged

duncanmcclean merged 5 commits into
mainfrom
import-entry-parents

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Oct 30, 2024 •

Copy link
Copy Markdown
Member

This pull request makes it possible to import parent entries, allowing you to retain your page hierarchy when migrating to Statamic.

If a mapping is configured for the "Parent" field, it'll get transformed like normal, but instead of saving to the entry's data, it'll append an array to the cache.

Then, after all the entries have been saved, the UpdateCollectionTreeJob job will loop through all the parents, sort them (parent entries need to be handled before their children), then the collection tree will be updated.

Closes #12.

To Do

  • Add a test for the UpdateCollectionTreeJob listener

@duncanmcclean
duncanmcclean marked this pull request as ready for review October 31, 2024 12:59
@duncanmcclean
duncanmcclean merged commit 9a51223 into main Oct 31, 2024
@duncanmcclean
duncanmcclean deleted the import-entry-parents branch October 31, 2024 13:01
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.

Respect hierarchy

1 participant