DFreds / dfreds-convenient-effects

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

Cannot drag and drop effects from the Convenient Effects menu to an item. #268

Closed Mr-Turing closed 11 months ago

Mr-Turing commented 1 year ago

Describe the bug Cannot drag and drop effects from the Convenient Effects menu to an item. Happens to both custom and default conditions, on all kinds of items, in character sheets or not.

Dragging other effects between items works as expected.

To Reproduce Steps to reproduce the behavior: 1.Open CE menu and item

  1. Drag effect to "temporary effects" section in the item's effect tab
  2. Nothing will happen
  3. See error in console

Expected behavior Expected the effect to be reproduced in the item with the correct duration and effects.

Console error message Uncaught (in promise) TypeError: undefined. Cannot read properties of null (reading 'uuid') [Detected 1 package: system:dnd5e] at ItemSheet5e._onDropActiveEffect (item-sheet.mjs:576:44) _onDropActiveEffect @ item-sheet.mjs:576 await in _onDropActiveEffect (async) _onDrop @ item-sheet.mjs:557 callback @ foundry.js:65379 _handleDrop @ foundry.js:65430

Additional context Foundry V11 305 DnD5e 2.2.2

Modules: Dfreds Convenient effects 5.0.3 Find the culprit 1.4.6 Libwwrapper 1.12.12.1 socketlib 1.0.13

DFreds commented 1 year ago

Thanks for the report, will fix

DFreds commented 1 year ago

This seems to be related to the fact that dnd5e is doing this.item.uuid === effect.parent.uuid before it does the drop. CEs don't have a parent defined, which sort of circumvents some assumptions from Foundry. Typically, active effects HAVE to be assigned to a parent like an actor or item. I'll see about fixing this or adding a null check in dnd5e

DFreds commented 11 months ago

This is fixed now that dnd5e handles it.