mclemente / fvtt-module-polyglot

Talk to others using a language you can speak and scrambles text you can't understand.
MIT License
41 stars 48 forks source link

Journal runes won't work with WFRP4e System 6.1.2 and Foundry V10 #256

Closed ghost closed 2 years ago

ghost commented 2 years ago

The (Foundry V10) Polyglot module Journal features only work if you edit them with the TinyMCE editor then revert the journal template to the default one. But even though I can enable and disable runes as GM in the default journal display, it doesn't display runes to players who don't have the language and any Polyglot text is automatically translated to them, making the module useless. Runes / translating works fine with chat features, though.

GM View: Can enable Runes image

Player View: Even though the player doesn't have the WrittenReikspiel language, they are able to read the journal. image

There is only one Journal display template available: image

Game System: Warhammer Fantasy Roleplay 4th Edition 6.1.2 Polyglot Version 1.8.2 Not Using Babele

mclemente commented 2 years ago

Is the Journal's ownership set to Owner? That's the only way I managed to reproduce this and it wouldn't be a bug, then. As the player, open the console (F12) and enter game.polyglot.known_languages on it. It should list all the known languages by that player. For example, on a brand-new character it should list only Reikspiel.

ghost commented 2 years ago

Thanks for the reply! Player permission was set to Observer only. However while opening the console as the player I stumbled into this (couldn't find game.polyglot.known_languages):

commons.js:1256 Error: You are accessing the ActorWfrp4e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1245:19)
    at ActorWfrp4e._logV10CompatibilityWarning (commons.js:6166:14)
    at get data [as data] (commons.js:6066:24)
    at warhammerLanguageProvider.getUserLanguages (LanguageProvider.js:2249:26)
    at Polyglot.getUserLanguages (logic.js:264:69)
    at Polyglot.updateUserLanguages (logic.js:279:58)
    at Polyglot.renderChatLog (logic.js:197:8)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at ChatLog._render (foundry.js:5071:13)
    at async ChatLog._render (foundry.js:59662:5)
    at async ChatLog._render (foundry.js:73270:5)
    at async Promise.all (index 2)
logCompatibilityWarning @ commons.js:1256
commons.js:1256 Error: You are accessing the ActorWfrp4e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1245:19)
    at ActorWfrp4e._logV10CompatibilityWarning (commons.js:6166:14)
    at get data [as data] (commons.js:6066:24)
    at warhammerLanguageProvider.getUserLanguages (LanguageProvider.js:2249:26)
    at Polyglot.getUserLanguages (logic.js:264:69)
    at Polyglot.updateUserLanguages (logic.js:279:58)
    at Polyglot.controlToken (logic.js:211:8)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at Token.control (foundry.js:25168:11)
    at #initializeTokenControl (foundry.js:23768:14)
    at #initialize (foundry.js:23682:33)
    at Canvas.draw (foundry.js:23574:29)
    at async Scene.view (foundry.js:20803:7)
    at async Scene.sceneView (monks-tokenbar.js:128:20)
    at async Game.initializeCanvas (foundry.js:7966:20)
    at async Game.setupGame (foundry.js:7804:5)
    at async Game._initializeGameView (foundry.js:8877:5)
    at async Game.initialize (foundry.js:7687:5)
logCompatibilityWarning @ commons.js:1256
commons.js:1256 Error: You are accessing the ActorWfrp4e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1245:19)
    at ActorWfrp4e._logV10CompatibilityWarning (commons.js:6166:14)
    at get data [as data] (commons.js:6066:24)
    at warhammerLanguageProvider.getUserLanguages (LanguageProvider.js:2249:26)
    at Polyglot.getUserLanguages (logic.js:264:69)
    at Polyglot.updateUserLanguages (logic.js:279:58)
    at Object.fn (logic.js:458:10)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at Object.fn (LanguageProvider.js:196:12)
logCompatibilityWarning @ commons.js:1256
foundry.js:711 TypeError: Cannot read properties of undefined (reading 'querySelectorAll')
[Detected 1 package: polyglot]
    at Polyglot.renderJournalTextPageSheet (logic.js:506:26)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at JournalSheet._renderPageViews (foundry.js:64146:15)
    at async JournalSheet._render (foundry.js:64109:5)
onError @ foundry.js:711
foundry.js:711 TypeError: Cannot read properties of undefined (reading 'querySelectorAll')
[Detected 1 package: polyglot]
    at Polyglot.renderJournalTextPageSheet (logic.js:506:26)
    at #call (foundry.js:688:20)
    at Hooks.callAll (foundry.js:645:17)
    at JournalSheet._renderPageViews (foundry.js:64146:15)
    at async JournalSheet._render (foundry.js:64109:5)
onError @ foundry.js:711
mclemente commented 2 years ago

Hm, that's odd. Could you export that journal's data and send it over here?

ghost commented 2 years ago

Sure thing. Here's a new console log, the journal jsons and the list of active modules (I've disabled most modules that got broken after the foundry V10 migration): logmodsjournals.zip

Thanks!

ghost commented 2 years ago

Just tested the new update with the player view and everything's fixed and working. Thanks again!!