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

When Journal Backlinks are not found Interface moves #21

Closed derSebastian closed 9 months ago

derSebastian commented 1 year ago

In a game of Ironsworn (Starforged) I noticed that the sidebar started moving to the left encroaching on the scene, but effectively making the foreground canvas smaller. The canvas was still visible however. I'll attach a video.

I believe that this happened due to a missing journal page (or several). I can't fully revert back. But turning on the debug mode showed:

journal-backlinks | appending links to Erin Jin
2journallink.js:249 journal-backlinks | DEBUG | adding link from JournalEntryPage People
journallink.js:249 journal-backlinks | ERROR | unable to find element to modify

Each time the NPC with a linked journal page was called. I tested this to this module by disabling all other modules and only having journal backlinks and the Ironsworn system active (see video).

I also tried re-syncing it from the Settings and there it encountered several other errors:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'biography')
    at JournalLink.updateActor (journallink.js:26:70)
    at #call (foundry.js:730:20)
    at Hooks.call (foundry.js:712:38)
    at #preUpdateDocumentArray (foundry.js:13673:44)
    at async ClientDatabaseBackend._updateDocuments (foundry.js:13448:22)
    at async IronswornActor.updateDocuments (commons.js:8001:23)
    at async IronswornActor.update (commons.js:8098:23)
    at async JournalLink.sync (journallink.js:215:21)

https://github.com/jtracey/journal-backlinks/assets/1211520/7930bd35-4791-462e-9529-45f87cdab638


Details: Foundry VTT version: 11.314 Ironsworn & Starforged : 1.22.8 Desktop App Mode On OSX Sonomoa 14.1

S-North commented 11 months ago

This happening to me also running a pf2e system. Everytime I open an npc token's sheet the sidebar moves to the left and I get warnings in the console;

journal-backlinks | appending links to Mitflit (elite) [journallink.js:257:17](http://nas1:3000/modules/journal-backlinks/scripts/journallink.js)
journal-backlinks | ERROR | unable to find entity (try the sync button?) [journallink.js:257:17](http://nas1:3000/modules/journal-backlinks/scripts/journallink.js)
journal-backlinks | ERROR | unable to find element to modify [journallink.js:257:17](http://nas1:3000/modules/journal-backlinks/scripts/journallink.js)

Foundry Version: 11.314 Client: Windows 11, Firefox and Chrome. System: Pathfinder Second Edition 5.9.5 Only the Journal Backlinks module enabled.

jtracey commented 11 months ago

If you know how, can you check if the workaround presented in #15 solves this issue? I suspect this issue is a duplicate, though I haven't had time to investigate (apologies to everyone affected).

ICronyI commented 9 months ago

Can confirm it happens also in Alien RPG system image

Stopped happening as soon as i disabled the module, sadly don't know how to use the fix presented in the previous message so i cannot test it :/

### EDIT: i'm smarter than i thought, and i think i managed to install that fix (basically just made the code changes indicated in the fix); using it fixed the issue for me, so it should be good!

jtracey commented 9 months ago

@ICronyI Thanks! I'll push a new version now, anyone experience any major breakage and I'll just push another version to revert.

jtracey commented 9 months ago

Version bumped, closing this issue.