flyingsquad / htmlfilter

1 stars 1 forks source link

DND v3.2.1 had some problems #2

Closed kagangtuya-star closed 3 months ago

kagangtuya-star commented 4 months ago

I have updated to DND 3.2.1 and encountered the following issues:

TypeError: Cannot read properties of undefined (reading 'ritual')
    at DnD5eObject.getValue (dnd5efilter.js:82:48)
    at HTMLFilter.resolve (htmlfilter.js:593:34)
    at HTMLFilter.process (htmlfilter.js:637:18)
    at HTMLFilter.directives (htmlfilter.js:758:10)
    at htmlfilter.js:666:9
    at Array.forEach (<anonymous>)
    at HTMLFilter.doForeach (htmlfilter.js:664:9)
    at HTMLFilter.directives (htmlfilter.js:791:11)
    at HTMLFilter.directives (htmlfilter.js:788:12)
    at HTMLFilter.filter (htmlfilter.js:852:8)
    at Object.onclick (htmlfilter.js:1014:6)

I checked some code and found that part of the data structure was modified. Below is the new format of the system part of the items. It seems that system.components.ritual has been removed and integrated into system.properties.

                "properties": [
                    "vocal",
                    "somatic",
                    "concentration",
                    "ritual",
                    "mgc"
                ],

This caused the following parts of the code to fail:

https://github.com/flyingsquad/htmlfilter/blob/85847ef05bfb372ac1e1fbdae5312a48322fb442/dnd5efilter.js#L115 https://github.com/flyingsquad/htmlfilter/blob/85847ef05bfb372ac1e1fbdae5312a48322fb442/dnd5efilter.js#L82

flyingsquad commented 4 months ago

Thanks for the heads up. I haven't updated anything to v12 because midi QOL isn't there yet, but once it and Chris's premades are available for v12 I will look into this.

kagangtuya-star commented 4 months ago

image

I did some repairs and it works fine now https://github.com/kagangtuya-star/htmlfilter_Print_Fonudry_Character_Sheet/blob/CN_dev/dnd5efilter.js If someone needs it, you can replace the code file of dnd5efilter.js directly.

flyingsquad commented 3 months ago

Your changes were incorporated and now the module is compatible with DnD 3.2.1 and 3.1.2.

flyingsquad commented 3 months ago

Closed.