Fix for advancements fail to add new items ("_id" readonly error. see #42)
This commit is contained in:
@@ -216,8 +216,11 @@ export class ItemL5r5e extends Item {
|
||||
}
|
||||
|
||||
// New id
|
||||
if (newId) {
|
||||
item._id = foundry.utils.randomID();
|
||||
if (newId || !item._id) {
|
||||
// Bypass the readonly for "_id"
|
||||
const tmpData = item.toJSON();
|
||||
tmpData._id = foundry.utils.randomID();
|
||||
item = new ItemL5r5e(tmpData);
|
||||
}
|
||||
|
||||
// Copy the parent permission to the sub item
|
||||
|
||||
Reference in New Issue
Block a user