vttred / ose

Old-School Essentials – Foundry VTT Edition
https://ose.vtt.red
GNU General Public License v3.0
96 stars 57 forks source link

fix: containers with phantom items can now delete #396

Closed anthonyronda closed 1 year ago

anthonyronda commented 1 year ago

This is my "elegant" one line fix for #310

The bug is caused by itemIds that never got removed from container data when the item itself was deleted

There's an argument for creating a migration that removes phantom itemIds from containers rather than using this method. I think we could make an enhancement request for that and remove this?

anthonyronda commented 1 year ago

I agree.

In case we ever require container validation on any other operations, I suppose the most elegant would be to fix invalid references with a migration step. Not sure which we'd actually need but I can think of a few "nice-to-haves"

bakbakbakbakbak commented 1 year ago

I have been thinking and I can't think of any scenarios this wouldn't be appropriate for.