Skip to content

Error selecting item grants during advancement. #303

@mark-clanfalconer

Description

@mark-clanfalconer

Steps to Reproduce

  1. Create a playbook

  2. Add an item grant type 'Advancement', level 0, no repeat
    2a. Add some move items to the item grant

  3. Add a second item grant, type 'Advancement', level 1, repeating
    3a. Add some move items to the grant, some of which are in the other item grant.

  4. Create an actor.

  5. Select the created playbook.

  6. On the item grant dialog. select one of the moves and choose OK.

  7. Advance the actor.

  8. On the item grant dialog, select one of the moves and choose OK.

Expected behaviour

On the initial selection, a move is added to the actor
On advancement, a move is added to the actor

Actual behaviour

On the initial selection, a move is added to the actor
On advancement, a selected move is not added to the actor.
The console shows

item.js:425 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'localeCompare')
    at _sortItemAdvancement (item.js:425:17)
    at Array.sort (<anonymous>)
    at item.js:414:49
    at Array.forEach (<anonymous>)
    at ItemPbta._preUpdate (item.js:412:31)
    at #preUpdateDocumentArray (foundry.mjs:58740:39)
    at async ClientDatabaseBackend._updateDocuments (foundry.mjs:58692:5)

Added a zip of a compendium with a playbook that exhibits the problem.
testadvancement.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions