Fix gulp/cleanPackData stripping _stats
Intent
During building packs/exporting packs we were removing the _stats
key from the data as we previously thought it was re-generated whenever an item was imported. Unfortunately this was not the case for unlinked tokens (Mooks/Containers etc.) which caused item validation to fail during Foundry's internal v11 migrations meaning unlinked tokens would lose those items/reset them.
This commit makes sure all compendia are updated with the _stats
key and removes deleting the _stats
key during cleanPackData
replacing it with a function that simply changes the _stats.lastModifiedBy
key to 00CPRCBuildBot00
which matches the way 5e does it.
As this is a hotfix MR the Commit
/Changes
tabs are not so helpful. Please use the below comparison the see the actual changes:
-
This is meant for a hotfix -
This is meant for the next release (see milestone) -
This needs more reviewers than normal; there may be controversy or high complexity -
This intentionally introduces regressions that will be addressed later -
There is/will be documentation changes on the wiki -
Please do not send commits here without coordinating closely with the owner -
This is a Build System change
Related Issues
- N/A
Steps to Test
- Check the commits
- All items now have
_stats
- All items now have
- Using Foundry v10
- Checkout this branch / Build / Load
- Create a new world
- Create new Mook
- Drag Mook into a Scene
- Add items to Mook Token from Compendia
- IMPORTANT! Must be the Token not the Actor
- Do the same with a Container
- Switch to Foundry v11
- Copy World you created above to your v11 environment
- Checkout
master
/ Build / Load - Load World
- Let any migrations happen
- Check Mook Token
- Has not lost items
- Check Container items
- Has not lost items
Future Work
Replicate the same functionality in master/v11/0.88. This will be done once this has been merged into master