Deleting and Creating Items on Character Sheet Breaks
ascendsauce opened this issue · comments
Issue
Add Item in "ITEMS" tab on character sheet causes error:
Uncaught TypeError: this.actor.createOwnedItem is not a function at CairnActorSheet._onItemCreate (systems/cairn/module/actor/actor-sheet.js:122) at HTMLAnchorElement.dispatch (jquery.min.js:2) at HTMLAnchorElement.v.handle (jquery.min.js:2)
Deleting existing items causes error similar error related to deleteOwnedItem method.
Cause
"action"OwnedItem on class Actor was deprecated by Foundry in favor of document entity generic actions. Also the base Actor is now a documentClass and the CairnActor class needs to extend that in the CONFIG in the module with:
CONFIG.Actor.documentClass = CairnActor;
instead of
CONFIG.Actor.entityClass= CairnActor;
Resolved by @olivier-grech