Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: most DnD Exports does not work #120

Open
1 task done
dave-bp opened this issue Dec 18, 2023 · 4 comments
Open
1 task done

[Bug]: most DnD Exports does not work #120

dave-bp opened this issue Dec 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@dave-bp
Copy link

dave-bp commented Dec 18, 2023

Expected Behavior

I select the mapping, click on expert, select in mapping mentioned PDF => get filled PDF

Current Behavior

If i try to export my DnD Character, the most of the mappings bring the error
grafik
The only DnD Mapping which works is the mapping for "charakterbogen_ataendler_v2.8.1.pdf".

Log:
grafik

Steps to Reproduce

  1. go to settings
  2. set Mapping to a DnD Sheept except the ataendler
  3. save
  4. download PDF which is mentioned in the mapping
  5. open DnD player Char
  6. Export to PDF
  7. select downloaded pdf
  8. -> Error

Context

No response

Version

0.24.9

Foundry VTT Version

11.315

Operating System

Windows 10

Browser / App

Firefox

Game System

DnD 5e

Modules Disabled

  • I can confirm that disabling all of my other modules doesn't fix this issue.
@dave-bp dave-bp added the bug Something isn't working label Dec 18, 2023
@fverdoja
Copy link

fverdoja commented Dec 23, 2023

Can confirm, same issue here, only the ataendler mapping exports correctly.

I can provide the json of one of sheets that fails to export if it can help.

Version

0.24.9

Foundry VTT Version

11.315

Game System

DnD5e 2.4.1

@fverdoja
Copy link

fverdoja commented Dec 23, 2023

I can provide the json of one of sheets that fails to export if it can help.

Here it is: fvtt-Actor-jebeddo-dei-mari-Ixby2TiGJNDB3KBu.json

@davelamorte
Copy link

Like I said in other posts, the workaround is simple, delete any extra language. If you only leave "common" it works.
I don't know anything how to fix the issue on the code.. otherwise I would have done myself; I found out about the workaround after a little testing weeks ago!

@ALXLight
Copy link

ALXLight commented Dec 29, 2023

The problem is the languages is not a straight map but an object, so line
" a = @ system.traits.languages.value.map(x => game.dnd5e.config.languages[x]).first();"
wont work.
It shold be rewritten ro recoursive search for getting obj[x] if it is string or dive deeper for f(obj[x].children).

UPD.
Managed to get it work for 'dnd5eV11extended'.

replaced
a = @ system.traits.languages.value.map(x => game.dnd5e.config.languages[x]).first();
by

function findValRecursively(m, x)
{
  for(let k in m)
  {
    if(k == x)
      return m[k];
    if(m[k] instanceof Object){
      let res = findValRecursively(m[k].children, x);
      if (res) 
      return res;
    }
  }
}
a =  @ system.traits.languages.value.map(x => findValRecursively(game.dnd5e.config.languages,x)).first();

Not sure if it is a good way but it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants