jtracey / journal-backlinks

A module for Foundry VTT that links entities (journal entries, actors and items) that reference each other
MIT License
4 stars 3 forks source link

Some Backlinks do not render in V11 #14

Open Muwak77 opened 11 months ago

Muwak77 commented 11 months ago

In Foundry V11 Some Items Unexplainably do net render without any error-message. I testet with the Investigator System, but not certain if it happens in other Systems.

jtracey commented 11 months ago

Yeah, I noticed this as well, but haven't had time to investigate further yet. I'll try to prioritize this and figure out what's going on.

Muwak77 commented 11 months ago

I think i found the issue:

when a link is stored but the page is deleted, the script crashes.

in IncludeLinks line 148 i replaced

let entity = game.documentIndex.uuids[value].leaves[0].entry;

with

let entity = game.documentIndex.uuids[value]?.leaves[0]?.entry;
if(entity===undefined) {
    continue;
}

seemed to do the trick, but needs further testing

jtracey commented 10 months ago

Sorry for taking so long to get back to this.

It looks like you're right, though that shouldn't be happening, and is a sign of some leakage. I'll use a (slightly modified) version of your solution for now, to avoid show-stoppers like the script crashing, but my hope is that it's mainly some sort of problem from the migration and that the working sync button should be enough to resolve it. I'll keep this open for now, keeping an eye out for other potential causes.