#Weird Scenes

1 messages · Page 1 of 1 (latest)

wooden pewter
#

Hey, could you run this bit of code in your console?

await ui.sidebar.tabs.scenes.getData()
#

You should have a spot where you can type at the bottom of the console

little seal
#

yup done

wooden pewter
#

What did it write out to the console?

little seal
#

{user: UserPF2e, tree: {…}, canCreate: true, documentCls: 'scene', tabName: 'scenes', …}

wooden pewter
#

ok, so there's no failure in the data builder. That's the data that gets used by Handlebars to fill in the scenes sidebar.

little seal
#

Also, in the Scenes Tab there is no option to create new scenes or folders

#

Just nothin

wooden pewter
#

right, with the console open, can you click the "Network" tab and then (keeping console open) refresh the page

little seal
#

I tried that already, no luck

wooden pewter
#

I'm just wondering if the scene html file is failing to download

little seal
#

Ok done again

wooden pewter
#

You'll want to scroll through the large list of entries and look for anything in red

little seal
#

Nothing in red

wooden pewter
#

ok, so everything is downloading correctly then

#

in the console try running this command:

game.user.isGM

that should print true to the console

little seal
#

It did

wooden pewter
#

ok, lol I'm slowly running out of ideas

little seal
#

I appreciate your time regardless

wooden pewter
#

It's extra hard when there are no errors in the console because they can usually direct us to the line of code that's failing

little seal
#

Is it possible that I'm missing the errors somehow?

wooden pewter
#

Doubtful, they show as all red text in the console

little seal
#

When I open up the console sidebar there is a set of stuff including an entry for errors that shows 2 but I don't know how to look at them

wooden pewter
#

ok, in the Console tab you should see this "Default levels" drop down

#

You can deselect the "Info" option

#

should clean up everything and only show the warnings and errors

little seal
#

Oh when I went to look at that it was grayed out and I noticed there was something in the filter. When I erased it, this appeared:

wooden pewter
#

Perfect!

#

line 3237 in the foundry.js file

little seal
#

Darn old line 3237

wooden pewter
#

ok, so I'm not sure at the moment why this is happening, but it looks like you're getting into what we call a Stack Overflow. Likely a function calling itself so much that it just dies. That would likely be caused by a circular reference inside of the data.

My best guess is something like a Folder referencing itself. Would cause literal Folder Inception lol

#

did you happen to have any modules that did folder stuff?

little seal
#

Uh probably

wooden pewter
#

Like increase the maximum number of folders allowed?

little seal
#

I did try to see if turning off the modules did anything and it didn't

#

However I also notice that in two my worlds, my Shared Folders (from the Shared Compendiums module) is no longer working

#

Which is true for this world

#

Have to go make dinner. Thanks for trying to help

wooden pewter
#

Yeah, it might be a case where you just need a script that will go through and delete all the folders

wooden pewter
#

Ok, when you have some time, I've written a macro script that specifically deletes all folders in the Scenes tab. This should hopefully work and restore your scenes. Just throw this code in a script macro and try running it

const folders = new Map();
function processFolder(folder) {
    if(folders.has(folder.id)) return;
    folders.set(folder.id, folder);
}
(async() => {
    const scenes = game.scenes.contents;
    for (const scene of scenes) {
        const folder = scene.folder;
        if (!folder) continue;
        processFolder(folder);
    }
    for(const folder of [...folders.values()]) {
        await folder.delete();
    }
})();