compendium errors upgrading to v9

hmm im not entirely sure how this will work though.. because I did just a quick smell test to my module under v9, and it broke on the compendium settings which is absolutely core to the module 😛 and I'm not sure if whatever I do to fix it will work on 0.8.x
6 Replies
corporat
corporat•4y ago
Mind sharing what errors you got? I know of one change that should only produce a deprecation warning
ccjmk
ccjmkOP•4y ago
i am .. not entirely sure, but I built a FormApplication on my module to have users select compendiums, and then I mapped those into an array. but the application result is now different
corporat
corporat•4y ago
And I know of at least one bug with compendiums
ccjmk
ccjmkOP•4y ago
its a little hard to explain, honestly, I would need to produce some examples and/or show you but I don't recall ANY deprecation message and/or error it just.. returned something different than before (firing up v8)
corporat
corporat•4y ago
There should be a deprecation warning if a pre-v9 compendium is being used in v9. The schema has changed Could be causing weirdness
ccjmk
ccjmkOP•4y ago
hmmm I did some HB shenanigans to implement this, registered a checked helper, but it's all a little finnicky, never fully understood what I was doing honestly xD so.. here's 0.8.9 working response.. when the FormApplication is closed, I get this formData on _updateObject(event, formData).
{"races":[false,false,false,false,false,true,false,false,false,false,false,false,false,false,false],"racialFeatures":[false,false,false,false,false,false,false,false,false,false,false,false,true,false,false],"classes":[false,false,false,true,false,false,false,false,false,false,false,false,false,false,false],"classFeatures":[false,false,false,false,true,false,false,false,false,false,false,false,false,false,false],"backgroundFeatures":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],"spells":[false,false,true,false,false,false,false,false,false,false,false,false,false,false,false],"feats":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false]}"
{"races":[false,false,false,false,false,true,false,false,false,false,false,false,false,false,false],"racialFeatures":[false,false,false,false,false,false,false,false,false,false,false,false,true,false,false],"classes":[false,false,false,true,false,false,false,false,false,false,false,false,false,false,false],"classFeatures":[false,false,false,false,true,false,false,false,false,false,false,false,false,false,false],"backgroundFeatures":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false],"spells":[false,false,true,false,false,false,false,false,false,false,false,false,false,false,false],"feats":[false,false,false,false,false,false,false,false,false,false,false,false,false,false,false]}"
those arrays of booleans map to the Item compendiums the user has on the world, I map those later into their appropriate names to save them reversed (e.g. races: { 'dnd5e.races': true, ...} IIRC) and what I get on v9.... (a min)
'{"races":["dnd5e.items","dnd5e.races"],"racialFeatures":["dnd5e.races"],"classes":["dnd5e.classes"],"classFeatures":["dnd5e.classfeatures"],"backgroundFeatures":[],"spells":["dnd5e.spells"],"feats":[]}'
'{"races":["dnd5e.items","dnd5e.races"],"racialFeatures":["dnd5e.races"],"classes":["dnd5e.classes"],"classFeatures":["dnd5e.classfeatures"],"backgroundFeatures":[],"spells":["dnd5e.spells"],"feats":[]}'
interestingly, this seems even easier to work with xD but I have no idea why this changed i don't remember why I didn't save stuff this way directly on the setting, but I will give it a try! saving exactly which compendiums have each data instead of marking them all should probably help a little with performance when reading them this is how my setting is supposed to look (i forgot I trimmed unused compendia hahah)
{
"races":{"dnd5e.races":true},
"racialFeatures":{"dnd5e.races":true},
"classes":{"dnd5e.classes":true},
"classFeatures":{"dnd5e.classfeatures":true},
"backgroundFeatures":{},
"spells":{"dnd5e.spells":true},
"feats":{}
}
{
"races":{"dnd5e.races":true},
"racialFeatures":{"dnd5e.races":true},
"classes":{"dnd5e.classes":true},
"classFeatures":{"dnd5e.classfeatures":true},
"backgroundFeatures":{},
"spells":{"dnd5e.spells":true},
"feats":{}
}
I do some complicated mappings back and forth, there might be an easier and more straightforward way of doing this :/
Want results from more Discord servers?
Add your server