foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
192 stars 10 forks source link

Applying ActiveEffects in systems without a system DataModel throws an error and never gets handled by the _applyLegacy method. #10788

Closed Fyorl closed 2 weeks ago

Fyorl commented 2 weeks ago

Originally reported by agaringer https://discord.com/channels/170995199584108546/1184176415139184731/1233790782306123776

Short Description of bug: Changes to V12 Active effect.apply() to support Data Models break AEs in systems that don't use Data Models Simple steps to reproduce the bug: Create an AE that modifies system data in a non-Data Model system https://discord.com/channels/170995199584108546/1184176344276406292/1233765905561948271

drewg13 commented 2 weeks ago

If it matters, "throws an error" undersells the issue a bit. If I throw in an optional chaining operator on the actor.system.schema?.getField() like so, that clears up the error neatly, but somehow AxtiveEffect._applyLegacy() still never gets reached, so no AEs in my system ever get applied under any circumstances that I could find.