earlSt1 / vtt-compendium-folders

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

Issues with dragging documents into compendiums from world #161

Closed earlSt1 closed 1 year ago

earlSt1 commented 1 year ago

Yea, no rush. Sorry to add more, but it seems that dragging any new or existing journal entry from the world into a compendium folder doesn't work either. Might be the same thing

From console when moving to any folder in a compendium:

Compendium Folders | Moving document PHFNdfCTJFY95yfv to new folder       
Uncaught (in promise) Error: The key PHFNdfCTJFY95yfv does not exist in the CompendiumCollection Collection
    at CompendiumCollection.get (commons.js:2826:15)
    at CompendiumCollection.get (foundry.js:14443:18)
    at ClientDatabaseBackend._preUpdateDocumentArray (foundry.js:12552:26)
    at async ClientDatabaseBackend._updateDocuments (foundry.js:12476:22)
    at async Actor5e.updateDocuments (commons.js:5652:23)
    at async FICUtils.packUpdateEntities (fic-folders.js:19:16)
    at async FICFolderAPI.applyUpdates (fic-folders.js:2840:9)
    at async FICFolderAPI.moveDocumentIntoFolder (fic-folders.js:2428:9)

From console when moving to root:

Compendium Folders | Moving document sX2mzfGNJyUx69lf to root
foundry.js:13635 
Uncaught (in promise) Error: Invalid Document type 'undefined' provided to Actor5e.fromDropData.
    at Actor5e.fromDropData (foundry.js:13635:13)
    at async Compendium._onDrop (foundry.js:71123:22)

fromDropData @ foundry.js:13635
await in fromDropData (async)
(anonymous) @ fic-folders.js:935
wrapper @ shim.js:40
callback @ foundry.js:55958
_handleDrop @ foundry.js:56009

Uncaught (in promise) Error: The key sX2mzfGNJyUx69lf does not exist in the CompendiumCollection Collection
    at CompendiumCollection.get (commons.js:2826:15)
    at CompendiumCollection.get (foundry.js:14443:18)
    at ClientDatabaseBackend._preUpdateDocumentArray (foundry.js:12552:26)
    at async ClientDatabaseBackend._updateDocuments (foundry.js:12476:22)
    at async Actor5e.updateDocuments (commons.js:5652:23)
    at async FICUtils.packUpdateEntities (fic-folders.js:19:16)
    at async FICFolderAPI.applyUpdates (fic-folders.js:2840:9)
    at async FICFolderAPI.moveDocumentToRoot (fic-folders.js:2558:13)
    at async FICUtils.handleMoveToRoot (fic-folders.js:283:13)

Originally posted by @tratos2 in https://github.com/earlSt1/vtt-compendium-folders/issues/160#issuecomment-1236103778

tratos2 commented 1 year ago

The above error was thrown when trying to drag a journal entry into an actor compendium. Was experimenting a bit, seemed I overlooked this "minor" :p detail. So this might not be too relevant

Dragging a journal page into a journal compendium root (not directly into a nested folder) works without errors :p

earlSt1 commented 1 year ago

I dont remember adding a way to drag directly from the world into a compendium folder, its just these errors that have popped up since v9.

I've added some checks which should stop those errors from being generated. Can you install the test version of CF to check if it solves your issue? To do so, uninstall your current version of CF and install this one using the manifest text box in the Install Module window: https://raw.githubusercontent.com/earlSt1/vtt-compendium-folders/10x-update/test/module.json (you wont lose any settings/compedium data doing this)

earlSt1 commented 1 year ago

Btw this error:

Uncaught (in promise) Error: Invalid Document type 'undefined' provided to Actor5e.fromDropData.
    at Actor5e.fromDropData (foundry.js:13635:13)
    at async Compendium._onDrop (foundry.js:71123:22)

is part of core foundry (you can test by disabling CF and doing the same thing)

tratos2 commented 1 year ago

I dont remember adding a way to drag directly from the world into a compendium folder, its just these errors that have popped up since v9.

I've added some checks which should stop those errors from being generated. Can you install the test version of CF to check if it solves your issue? To do so, uninstall your current version of CF and install this one using the manifest text box in the Install Module window: https://raw.githubusercontent.com/earlSt1/vtt-compendium-folders/10x-update/test/module.json (you wont lose any settings/compedium data doing this)

Did the manual install of the test version. Everything seems to work as expected now. The core version thing persisted with CF disabled indeed. Thanks so many for your hard work, CF is such a wonderful module!

earlSt1 commented 1 year ago

Great to hear, i'll push an official release tomorrow. You will be able to update to the official version through foundry by checking for updates as normal 😄

earlSt1 commented 1 year ago

Fixed in v2.5.4