jessev14 / pf2e-staves

MIT License
5 stars 9 forks source link

Adding or manipulating a staff doesn't create the spell entries in PF2E 4.12.7 or 4.12.8 #28

Open Daso78 opened 1 year ago

Daso78 commented 1 year ago

I've tried adding a staff but I get quite a bit of red text in the console, and the spell casting entry doesn't get created. Another user on discord has confirmed that they had the same bug.

The console text is as follows: Uncaught (in promise) TypeError: undefined. strs is not iterable main.js:217 [Detected 1 package: pf2e-staves] at createStaveSpellcastingEntry (main.js:217:27) at Object.fn (main.js:34:12) at #call (foundry.js:724:20) at Hooks.callAll (foundry.js:681:17) at ClientDatabaseBackend.callback (foundry.js:12613:13) at foundry.js:12594:43 at Array.map () at ClientDatabaseBackend._handleCreateEmbeddedDocuments (foundry.js:12594:33) at ClientDatabaseBackend._createEmbeddedDocuments (foundry.js:12499:17) at async Proxy.createDocuments (commons.js:6110:23)

MatthewSmit commented 1 year ago

Replacing line 216 with the following seems to fix it for me.

        const strs = match[0].match(/(@UUID\[Compendium\.|@Compendium\[)(.*?)]/g);
        // instead of
        const strs = match[0].match(/(@UUID\[Compendium\.|@Compendium\[)(.*?)].*?}/g);

It's a quick and dirty fix, so no promises that it's stable. Worked for my tests however.

Daso78 commented 1 year ago

that worked for me. thanks for the work around while we wait for an update.