foundryvtt / world-anvil

A module to integrate World Anvil with Foundry Virtual Tabletop.
MIT License
12 stars 7 forks source link

Update for foundry v12 #76

Open Billiam9420 opened 3 months ago

Billiam9420 commented 3 months ago

Just realized this is not yet updated for v12. My existing articles work, and can be synced, however I can't import new ones! The WA button in the journal tab is unresponsive.

aaclayton commented 3 months ago

Thanks for the report. We've been very busy with high priority items so I haven't had a chance to look at this module in a while. I'm definitely looking for contributors who are able to help maintain it. I'll try and look at it soon!

Alikzander13 commented 2 months ago

Literally made an account just to follow this! hoping for an update in the near future. I relied on this feature heavily. Thanks for all the work you do! Wish I had the skills to help lol

SnowDark38 commented 1 month ago

Sharing error related to this.

WA Button is visible and clickable. Clicking button elicits the following error in the console.

Error: An error occurred while rendering WorldAnvilBrowser 35. Cannot read properties of undefined (reading 'OBSERVER')
    at Hooks.onError (foundry.js:630:24)
    at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
    at 🎁Hooks.onError#lib-wrapper (listeners.js:138:11)
    at 🎁Hooks.onError#0 (libWrapper-wrapper.js:187:52)
    at foundry.js:5770:13Caused by: TypeError: Cannot read properties of undefined (reading 'OBSERVER')
    at WorldAnvilBrowser.getContentTree (journal.js:123:103)
    at async WorldAnvilBrowser.getData (journal.js:81:18)
    at async WorldAnvilBrowser._render (foundry.js:5813:18)
Tillerz commented 1 month ago

Can confirm, same error.

Tillerz commented 1 month ago

I just checked. If you go to modules/world-anvil/module/journal.js and comment out line 123, the list or articles shows up again.

article.visibleByPlayers = article.entry?.ownership.default >= CONST.DOCUMENT_PERMISSION_LEVELS.OBSERVER;

Comment it out by adding // in front.

ALAS, this deactivates the check if a page is visible to the players.

Tillerz commented 1 month ago

Found the error and fix it.

Pull Request here: https://github.com/foundryvtt/world-anvil/pull/78/commits/852d0fc0b42ec8386c2e549062857641d66f4d76

CONST.DOCUMENT_PERMISSION_LEVELS. is now CONST.DOCUMENT_OWNERSHIP_LEVELS.

SnowDark38 commented 1 month ago

Thank you for looking into it! The only thing I know how to do is pull errors XD

perlchild commented 1 week ago

Thank you, my foundryv12 now updates from WorldAnvil.