r1tsuu / payload-enchants

Payload 3.0 enchantment packages
MIT License
132 stars 8 forks source link

Issues with nested block IDs #65

Closed lynndylanhurley closed 3 months ago

lynndylanhurley commented 4 months ago

When copying collections with several layers of nesting, the IDs of the children are getting copied as well, which results in the following error:

 ERROR: TypeError: Cannot read properties of undefined (reading 'pages_blocks_accordion_block_items_pkey')

In this case the structure looks like this:

It seems like the IDs for everything are getting pulled in from the original doc, and payload adds unique constraints for the block and collection ids. For example, a block within one page can't share an ID with a block in another collection.

lynndylanhurley commented 3 months ago

Just opened a PR that resolved this for my project.