wintersleepAI / foundry-swnr

Stars Without Number: Revised for Foundry VTT
GNU Affero General Public License v3.0
31 stars 21 forks source link

Item issue #26

Closed justinthejaguar closed 1 year ago

justinthejaguar commented 2 years ago

Item descriptions for the item type disappear after update in v10.

CptSauceBucket commented 2 years ago

I'm having a similar issue. Wracked my head at first thinking it was a module clash.

Cup-of-Coffee commented 1 year ago

A snippet of the error outputted when you attempt to save a edit.

Screenshot 2022-10-03 100412

Screenshot 2022-10-03 100420

giuseppe-crea commented 1 year ago

Digging around with the debugger I've noticed that the editor.instance reads as null. image

This bug doesn't happen when editing the description of an Actor sheet, there the editor.instance is properly defined, but since I'm not versed in Foundry I don't know what to make of that.

It seems like the problem is that clicking the edit button on the description in an item's sheet never triggers the ActivateEditor method.

giuseppe-crea commented 1 year ago

Okay after further research I can confidently say that the issue is the original author's override of activateEditor found here

https://github.com/wintersleepAI/foundry-swnr/blob/992d59e5aa8c096d1a76fb11464d6d570a01a7e5/src/module/items/base-sheet.ts#L37-L54

Deleting the method entirely restores functionality to item sheets. I'm not sure why this override exists as it does not seem to do anything on top of the default functionality of the activateEditor method. I created PR #31 to address this issue, but have not had time to extensively test this solution.

wintersleepAI commented 1 year ago

Will be resolved in next release. Thanks @giuseppe-crea again!