arcanistzed / pdf-sheet

A system agnostic tool to export your Foundry character sheet to a PDF!
https://arcanist.me
MIT License
14 stars 58 forks source link

[Bug]: pf2e 4.2.1 export fails using the PDF in the official mapping #53

Open Ghilteras opened 1 year ago

Ghilteras commented 1 year ago

Expected Behavior

export works

Current Behavior

export does not work

foundry.js:58526 PDF Sheet | Invalid mapping JavaScript Object. See the <a href="https://github.com/arcanistzed/pdf-sheet/blob/main/README.md">README</a> for more info.
fetch @ foundry.js:58526

Steps to Reproduce

Context

N/A

Version

latest

Foundry VTT Version

10

Operating System

Windows

Browser / App

Chrome

Game System

pf2e

Modules Disabled

JairVianna commented 1 year ago

Hi, I found the problem in the "Class DC" Section, line 144 from Pathfinder 2e mapping and this happens only to a few characters. The line is:

{ "pdf": "ClassDC_KeyMod", "foundry": @data.attributes.classDC?.modifiers**.filter(i => i.type === 'ability')**.map(i => i.modifier < 0 ? i.modifier : '+'+ i.modifier) },

More specifaclly ".filter" section.

Removing all "Class DC" entry, the mapping works fine.

arcanistzed commented 1 year ago

@BlauKreuz

BlauKreuz commented 1 year ago

Last mapping update was made for PF2e 4.2.2 and the current PF2e version is 4.2.6. In 4.2.2 "modifiers" got changed to "_modifiers" and it was updated in the mapping accordingly. If you require an older mapping, please send pm to Kurko#1535 in Discord.

Also, note that if you have entered the mapping with copy/paste, it does not get updated automatically when the module is updated. You have to reselect the mapping from the pull down menu.