DFreds / dfreds-convenient-effects

A FoundryVTT module that adds easy to use toggleable active effects for any system.
MIT License
47 stars 39 forks source link

Can't open Conventient effect menu after update #236

Closed Ikabodo closed 1 year ago

Ikabodo commented 1 year ago

Describe the bug It looks like the fix on nested effects broke something in the last update.

To Reproduce Click the "Add convenient effects" button. Check error log.

Expected behavior Window to choose effect should open.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

Foundry VTT | Rendering ConvenientEffectsApp
foundry.js:747 TypeError: An error occurred while rendering ConvenientEffectsApp 185. Cannot read properties of undefined (reading 'changes')
[Detected 1 package: dfreds-convenient-effects]
    at handlebar-helpers.js:70:40
    at Array.flatMap (<anonymous>)
    at ActiveEffect5e.<anonymous> (handlebar-helpers.js:69:40)
    at ActiveEffect5e.c (handlebars.min.js:27:19853)
    at eval (eval at createFunctionContext (handlebars.min.js:29:1808), <anonymous>:21:147)
    at h (handlebars.min.js:27:17870)
    at c (handlebars.min.js:27:6899)
    at Object.<anonymous> (handlebars.min.js:27:7289)
    at Object.c (handlebars.min.js:27:19853)
    at eval (eval at createFunctionContext (handlebars.min.js:29:1808), <anonymous>:17:49)
    at h (handlebars.min.js:27:17870)
    at c (handlebars.min.js:27:6899)
    at Object.<anonymous> (handlebars.min.js:27:7289)
    at Object.c (handlebars.min.js:27:19853)
    at Object.eval [as main] (eval at createFunctionContext (handlebars.min.js:29:1808), <anonymous>:15:49)
    at c (handlebars.min.js:27:15429)
    at d (handlebars.min.js:27:15744)
    at e (handlebars.min.js:28:22748)
    at renderTemplate (foundry.js:6948:10)
    at async ConvenientEffectsApp._renderInner (foundry.js:5271:16)
    at async ConvenientEffectsApp._render (foundry.js:5114:19)
Ikabodo commented 1 year ago

Ehm. Looks like it's still there after a revert to 4.1.1. I'll need to investigate.

Ikabodo commented 1 year ago

I figured this out. It was not related to the upgrade after all. Turned out I had created a custom nested effect, then foolishly renamed one of the nested ones. This caused the module to break when trying to load the menu since it was reffering to an effect that doesn't exist. I could fix it by editing items.db.

I think you can close this, but I would consider adding a fail safe if a player renames an effect that is part of a nested effect.

DFreds commented 1 year ago

Ah, that's a great failsafe to add. I'll keep this open and fix it

DFreds commented 1 year ago

Fixed in v4.1.3