earlSt1 / vtt-compendium-folders

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

Fixes loading of folders for rendering compendia #73

Closed jsartisohn closed 3 years ago

jsartisohn commented 3 years ago

When building the folder tree before rendering a compendium folder structure, folder entries overwrite/reset their content list if they are encountered after non-folder entries. This results in items not being added to their respective folders when rendered in the compendium view.

Steps to reporduce the observed behavior:

  1. Create an item folder
  2. Create an item with the name "[some] item" in that folder
  3. (Optional) Create an item with the name "some item" in that folder
  4. Export that folder to a compendium.
  5. Open the exported item compendium.
  6. Observe "[some] item" being displayed outside of the folder.

The compendium db itself is being exported correctly and importing it into a game world seems to preserve the original folder structure. That said, viewing (the unlocked) compendium list allows drag&dropping those seemingly stray items into their original folders. This resulted in those items still not being rendered in the folder but instead being duplicated in the compendium db, which I guess is bad?

earlSt1 commented 3 years ago

Hi, I actually spotted this issue while doing work on the 0.8.2 release. I was going to merge my version of the fix back into the 0.7.9 version over the weekend.

Thanks for applying this quick fix! I'll merge it into the 0.7.9 version and expand on it over the weekend. I'll also make a note of the issue with moving an entry duplicating in the folder data.