Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to edit journal entries when Polyglot is enabled. #41

Closed
jack-liska opened this issue Sep 3, 2020 · 12 comments
Closed

Unable to edit journal entries when Polyglot is enabled. #41

jack-liska opened this issue Sep 3, 2020 · 12 comments
Labels
question Further information is requested

Comments

@jack-liska
Copy link

When Polyglot is enabled clicking the edit button in the top right of the text field in the journal causes all text to disappear and the edit UI does not appear at the top of the text field.

Text can be typed still, but no edits save.

Running on a Pi4B, narrowed down using Find the Culprit.

@kakaroto
Copy link
Collaborator

kakaroto commented Sep 4, 2020

What version of Foundry and which system (and version of the system) and which version of polyglot ?
Find the Culprit may have been able to identify the cause as being Polyglot but can you confirm that enabling the module breaks journal entries and disabling it fixes it ? Is it possibly an incompatibility with another module that also needs to be enabled (i.e: did you test this with nothing but polyglot enabled) ?
It all looks good from my side both with 0.6.6 and 0.7.1

@kakaroto kakaroto added the question Further information is requested label Sep 4, 2020
@jack-liska
Copy link
Author

Foundry is 0.6.6 running on a RasPi 4b 2GB, Polyglot 1.1.1

I've run with only Polyglot active and the problem persists.

@kakaroto
Copy link
Collaborator

kakaroto commented Sep 4, 2020

I can't reproduce it and you're the first one to mention this issue.
What browser are you using and did you try a different browser? Although that shouldn't really matter since you say it works without the module...

Can you press F12 to open the dev console in Foundry and see if there's any errors in the console when you try to edit a journal entry ? If there is, please screenshot the console.

@jack-liska
Copy link
Author

It occurs on both Firefox and Chrome and in both the OSE and 5e module.

An error occurs, pasting text

theme.min.js:9 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at N.customFormats (theme.min.js:9)
at theme.min.js:9
at it (theme.min.js:9)
at N (theme.min.js:9)
at uO (theme.min.js:9)
at N.customFormats (theme.min.js:9)
at theme.min.js:9
at it (theme.min.js:9)
at N (theme.min.js:9)
at uO (theme.min.js:9)
N.customFormats @ theme.min.js:9
(anonymous) @ theme.min.js:9
it @ theme.min.js:9
N @ theme.min.js:9
uO @ theme.min.js:9
N.customFormats @ theme.min.js:9
(anonymous) @ theme.min.js:9
it @ theme.min.js:9
N @ theme.min.js:9
uO @ theme.min.js:9
(anonymous) @ theme.min.js:9
map @ theme.min.js:9
aO @ theme.min.js:9
(anonymous) @ theme.min.js:9
FS.fire @ tinymce.min.js:9
fire @ tinymce.min.js:9
nS @ tinymce.min.js:9
fS @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
ir @ tinymce.min.js:9
o @ tinymce.min.js:9
Ca.loadScripts @ tinymce.min.js:9
Ca.loadQueue @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
e @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
ir @ tinymce.min.js:9
o @ tinymce.min.js:9
Ca.loadScripts @ tinymce.min.js:9
Ca.loadQueue @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
vS @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
xN.render @ tinymce.min.js:9
n @ tinymce.min.js:9
(anonymous) @ tinymce.min.js:9
ir @ tinymce.min.js:9
e @ tinymce.min.js:9
vo.executeHandlers @ tinymce.min.js:9
m @ tinymce.min.js:9
go @ tinymce.min.js:9
vo.bind @ tinymce.min.js:9
U @ tinymce.min.js:9
init @ tinymce.min.js:9
create @ foundry.js:14103
_createEditor @ foundry.js:4910
sheet._createEditor @ polyglot.js:401
button.onclick @ foundry.js:4897
Show 20 more frames****

@kakaroto
Copy link
Collaborator

kakaroto commented Sep 4, 2020

Thank you, that was helpful! I'm able to reproduce this here now, by modifying the languages that Polyglot finds. I'm not sure though how you could have the situation where the bug happens.
That shouldn't affect, but do you have any custom languages set in the Polyglot settings ?
In the dev console, can you type the following commands and screenshot the result (make sure you click on the little arrow to the result) :

PolyGlot.languages

and then with both polyglot enabled and disabled :

CONFIG.DND5E.languages

Hopefully that helps me figure out what caused it. In the meantime, I can add a workaround so if it happens again, it won't affect the editor.

@jack-liska
Copy link
Author

Will do!

PolyGlot.languages
image

CONFIG.DND5E.languages with
image

CONFIG.DND5E.languages without

image

Please let me know if this isn't right/you need something else. I'm new to helping debug this sort of thing!

@kakaroto
Copy link
Collaborator

kakaroto commented Sep 4, 2020

Thanks... this is... I don't know what to think of this, lol. You've been very helpful though in figuring it out!

Since it doesn't work for DND5E, and I noticed you mentioned OSE earlier, I just checked with the OSE system and I'm now getting the problem. I don't know if OSE changed something recently to the system that caused it to act that way, but this is indeed quite weird.
Maybe @mesfoliesludiques knows why the languages is an Array instead of an Object, and whether it's a new change or it was a bug from the start.
Note that you said dnd5e also had the problem, can you confirm if that's true ?
Anyway, I've made appropriate fixes to prevent this and made a new release (v1.1.2) which works now with OSE.
Thanks for reporting and in your patience in debugging this issue!

@jack-liska
Copy link
Author

I'll respond with a check on 5e in the morning. Happy to help!

@mesfoliesludiques
Copy link
Contributor

Hi !
I am pushing an update to OSE that should solve the issue. Let me know.

@kakaroto
Copy link
Collaborator

kakaroto commented Sep 4, 2020

Thanks for the quick reaction!
I've fixed it with this : 579a866
I'll wait for your release and see how I can make it compatible with both old and new version.

@mesfoliesludiques
Copy link
Contributor

mesfoliesludiques commented Sep 4, 2020

I had an issue, my translation logic was faulty, you should not have to update anything !

@jack-liska
Copy link
Author

Tested with both updates applied and it's working correctly now for me in both OSE and 5e!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants