DFreds/dfreds-convenient-effects

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

Closed this issue · 3 comments

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
2. Drag effect to "temporary effects" section in the item's effect tab
3. Nothing will happen
4. 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

Thanks for the report, will fix

DFreds commented

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

This is fixed now that dnd5e handles it.