Bug - Levels interfering with update embedded documents function
diwako opened this issue · 2 comments
Foundry: Version 10 Build 291
Levels: 3.6.6
Wall Height: 4.9.1
Better Roofs; 1.7.6
Hey,
I recently updated another module which ran a migration on tokens. That module is Item Piles.
During start up of the Foundry instance I saw a ton of these errors in the console.
TypeError: Cannot read properties of null (reading 'id')
[Detected 2 packages: levels, item-piles]
at FoWHandler.createTokenBubble (fowHandler.js:45:27)
at Object.fn (fowHandler.js:29:12)
at #call (foundry.js:724:20)
at Hooks.callAll (foundry.js:681:17)
at ClientDatabaseBackend.callback (foundry.js:12824:13)
at foundry.js:12804:43
at Array.map (<anonymous>)
at ClientDatabaseBackend._handleUpdateEmbeddedDocuments (foundry.js:12804:33)
at ClientDatabaseBackend._updateEmbeddedDocuments (foundry.js:12672:17)
at async TokenDocument.updateDocuments (commons.js:6153:23)
at async 2.4.0 (migrations.js:89:7)
at async runMigrations (migrations.js:23:7)
at async module.js:88:7
I already have talked to the creator of the Item Piles module about this error, they directed me here seeing that it looks like Levels is interfering somehow.
Supposedly this line is failing and it is a fundemantal foundry function, or so I was told.
await scene.updateEmbeddedDocuments("Token", updates);
Link to the item piles source code:
https://github.com/fantasycalendar/FoundryVTT-ItemPiles
https://github.com/fantasycalendar/FoundryVTT-ItemPiles/blob/master/src/migrations.js#L89
Fixed, but I doubt this levels bug is the cause of the problem
Thank you. Just tried it out the migrations do run now without any errors