earlSt1 / vtt-compendium-folders

Collapsable folders in the compendium directory and folder structures inside compendiums for FoundryVTT
21 stars 18 forks source link

Exporting folder structure doesn't work right with unlinked placeables #201

Open dineshm72 opened 1 year ago

dineshm72 commented 1 year ago

I'm not quite sure how best to describe this issue. I have a scene that has a mix of normal tokens and unlinked tokens (tokens with the represented actor set to "None").

I can export the scene for the first time, delete it, and then import it and it seems to be fine.

Then if I try to delete those unlinked tokens, and then "export folder structure" on the folder containing this scene (with merge by name off, and keep doc id's on), it will appear to export with no errors in the console other than some v10 deprecation warnings.

If I then reimport the scene (using the import folder structure button), it will reimport the scene, but the unlinked tokens which I had deleted are back.

I thought maybe the export wasn't working, but if I repeat the above process, and this time in addition to deleting the unlinked tokens, I also add some new normally-linked tokens, then do the export, then reimport, you find that the new tokens are there as expected, so they were export/imported, but the deleted unlinked tokens are also still there, so their deletion has gotten lost.

The same behavior exists for unlinked map note pins, where the journal entry and page entry dropdowns are set to the blank option at the top of the dropdown list (and show up as Unknown if you mouse over them). You can delete them, but they don't stay deleted if you export then import. As soon as you relink them to a journal, they export and import normally, as expected.

I'm not sure what is going on behind the scenes when you're doing this export and import, but something weird is happening with unlinked placeables.

dineshm72 commented 1 year ago

If you delete the compendium scene that you're about to overwrite each time before exporting, it seems to work as expected, so that is a workaround, but it is cumbersome and prone to human error that could result in loss of data, which is not desirable.