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 in TextEditor#_onDragEntityLink #5990

Closed
aaclayton opened this issue Oct 11, 2021 · 1 comment
Closed

Bug in TextEditor#_onDragEntityLink #5990

aaclayton opened this issue Oct 11, 2021 · 1 comment
Assignees
Labels
bug Functionality which is not working as intended compendium Issues related to Compendium packs text-editor Issues related to the ProseMirror or legacy TinyMCE text editor

Comments

@aaclayton
Copy link
Contributor

Originally in GitLab by @mbrunninger

In order to submit an effective bug report, please include the following information along with your issue description.

Environment Details

Please share the following basic details about your setup.

  • Foundry VTT Version: (Example 0.8.9)
  • Operating System: [Windows]
  • How Are You Using Foundry: [Firefox]

Issue Description

The code shown below checks pack.index.length, which must be pack.index.size for a.dataset.lookup to work properly.

index is a Map, not an Array.

foundry.js:21670-21679 (TextEditor#_onDragEntityLink)

if ( a.dataset.pack ) {
  const pack = game.packs.get(a.dataset.pack);
    let id = a.dataset.id;
    if ( a.dataset.lookup && pack.index.length ) {
                                        ^^^^^^
      const entry = pack.index.find(i => (i._id === a.dataset.lookup) || (i.name === a.dataset.lookup));
      if ( entry ) id = entry._id;
    }
  if ( !id ) return false;
  dragData = { type: pack.entity, pack: pack.collection, id: id };
}
@aaclayton
Copy link
Contributor Author

Originally in GitLab by @mbrunninger

mentioned in issue mbrunninger/fvtt-hexxen-1733-core#29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended compendium Issues related to Compendium packs text-editor Issues related to the ProseMirror or legacy TinyMCE text editor
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants