earlSt1 / vtt-compendium-folders

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

FOLDER_SEPARATOR seems to be undefined? #89

Closed richardgaywood closed 2 years ago

richardgaywood commented 2 years ago

When I drag items out of a befoldered-compendium onto a PC's sheet, I get this error, seemingly100% of the time:

compendium-folders.js:2422 
Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
    at createFolderPath (compendium-folders.js:2422)
    at importFolderData (compendium-folders.js:2416)
    at compendium-folders.js:3194
    at Function._call (eval at <anonymous> (listeners.js:56), <anonymous>:4:14)
    at Function.callAll (foundry.js:153)
    at ClientDatabaseBackend.callback (foundry.js:8681)
    at foundry.js:8651
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleCreateEmbeddedDocuments (foundry.js:8651)
    at ClientDatabaseBackend._createEmbeddedDocuments (foundry.js:8544)

I can repro this with other actions too - eg, having dragged an item of gear, if I try to Equip it, I see the same message.

I'm using Foundry 0.8.8, SWADE 0.20.3. Bunch of other modules installed but nothing that should interact with this I think.

The affected line of code is

    let segments = path.split(FOLDER_SEPARATOR);

Other than the error message it seems to work fine; the action completes... Let me know if you want me to try and repro or test anything!

earlSt1 commented 2 years ago

Hi, what version of compendium folders are you using?

richardgaywood commented 2 years ago

Oops, you'd think I was smart enough to have included that in the bug report, wouldn't you?

It's v2.3.2, which I believe is the latest...?

In case it matters: this is dragging items from the Compendiums that shipped with the SWADE and Sprawlrunners premium modules.

earlSt1 commented 2 years ago

Hi, sorry for the wait. So this appears to be an issue with the compendium itself, i've had a few other users report the same thing when moving to 0.8.x.

I've been working on a compendium fixer that should automatically repair your compendium. It's live on my test environment if you want to give it a go? I tested it locally with a few compendiums and it seemed to work ok.

The workflow for this new process is:

  1. Duplicate your problematic compendium
  2. Select Fix Compendium in the module settings
  3. Select the duplicated compendium
  4. You should get a dialog displaying all the issues with your compendium. a. Take a screenshot of this just to be safe
  5. Click Attempt to Fix a. If you see a notification at the top of the screen saying "Repair Complete" or something, then it should have worked. b. If not, and something is wrong, then you should get a popup with some error messages which will help me if you send them over :smile:

This is still a work in progress, but once done then people can use this utility to hopefully auto-fix their compendiums.

To install the testing version, uninstall your current version of compendium folders and install this one using the manifest link at the bottom of the install module screen: https://raw.githubusercontent.com/earlSt1/vtt-compendium-folders/082-update/test/module.json

earlSt1 commented 2 years ago

Hi, can you try using the Fix my Compendium feature now included in the module? I'll close this issue for now but if you encounter any problems with it I'll reopen the issue.