SvenWerlen / moulinette-core

FoundryVTT module which provides a set of tools for DMs for managing assets.
https://www.patreon.com/moulinette
MIT License
41 stars 10 forks source link

Scenes module doesn't work without tiles module #19

Closed rlach closed 3 years ago

rlach commented 3 years ago

I've tried adding only core and scenes modules to a new world.

This appeared in the console:

(anonymous) @ moulinette-file-util.js:420
Promise.catch (async)
buildAssetIndex @ moulinette-file-util.js:419
async function (async)
buildAssetIndex @ moulinette-file-util.js:437
getPackList @ moulinette-scenes.js:29
async function (async)
getPackList @ moulinette-scenes.js:28
getData @ moulinette-forge.js:74
_render @ foundry.js:2042
_render @ foundry.js:2729
render @ foundry.js:2004
_openMoulinette @ moulinette.js:143
(anonymous) @ moulinette.js:123
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
foundry.js:2006 TypeError: An error occurred while rendering MoulinetteForge 84: Cannot read property 'files' of undefined
    at Function.buildAssetIndex (moulinette-file-util.js:423)
    at async MoulinetteScenes.getPackList (moulinette-scenes.js:29)
    at async MoulinetteForge.getData (moulinette-forge.js:74)
    at async MoulinetteForge._render (foundry.js:2042)
    at async MoulinetteForge._render (foundry.js:2729)

Which shouldn't be the case, because scenes module doesn't need images/custom. The scenes button appeared in moulinette menu, but it was impossible to open the scenes browser view.

I installed core, scenes and tiles modules at once then. The tiles module created necessary structure, and then scenes started to work. Afterwards it was even possible to remove the tiles module and scenes module continued to work.

Either make it so scenes module can work with just core, or add tiles module as dependency for scenes.

rlach commented 3 years ago

On closer look it's just an issue with buildAssetIndex, where it tries to check image index for no reason.

SvenWerlen commented 3 years ago

I've not been able to reproduce this issue. I even checked the scenes module and it doesn't try to index images/tiles. I could implement a check in the buildAssetIndex if it's really required. Feel free to reopen this issue if it's the case.