MrPrimate / tokenizer

Tiny yet capable in-game token editor for Foundry VTT
MIT License
28 stars 25 forks source link

[Bug] Default file picker doesn't open #143

Closed coldmug closed 7 months ago

coldmug commented 7 months ago

When choosing to open the default file picker, it doesn't open, and there is no other feedback. Looking at the console I get this error message.

hooks.js:276 Uncaught TypeError: Cannot read properties of undefined (reading 'img')
    at HTMLImageElement.<anonymous> (hooks.js:276:1)
    at HTMLImageElement.dispatch (jquery.min.js:2:43184)
    at y.handle (jquery.min.js:2:41168)

What should happen:

Default file picker should be launched, allowing picking an avatar image.

Details

Digging in a bit, this line in hooks.js is calling a non-existent member data.actor["img"], where it should directly call data.img

current: data.actor[dataEditField]

MrPrimate commented 7 months ago

Its sounds like you are using a system that has a non-standard img location for actor images in it's data model. Please can you provide what system you are using, as well as the version of Foundry, as it does not do this in the systems I have tested.

coldmug commented 7 months ago

That could be it! And apologies for not putting in system information before

System: Old School Essentials v1.9.4 Foundry Version: 11 Stable, Build 315 Tokenizer version: 4.2.6

Would it be possible to have an if system == "ose" or similar?

MrPrimate commented 7 months ago

That could be it! And apologies for not putting in system information before

System: Old School Essentials v1.9.4 Foundry Version: 11 Stable, Build 315 Tokenizer version: 4.2.6

Would it be possible to have an if system == "ose" or similar?

Yep, I already do this for some other systems, I'll check this out, probably tomorrow and get a fix out ASAP.

MrPrimate commented 7 months ago

SHould be working for you now in 4.2.7

coldmug commented 7 months ago

It does indeed. Thank you!