Fix for advancements fail to add new items ("_id" readonly error. see #42)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# Changelog
|
||||
Date format : day/month/year
|
||||
|
||||
## 1.9.1 - ??/??/2022 - ???
|
||||
- Fix for advancements fail to add new items ("_id" readonly error. see #42).
|
||||
|
||||
## 1.9.0 - 01/09/2022 - Foundry v10 Compatibility
|
||||
__! Be certain to carefully back up any critical user data before installing this update !__
|
||||
- Updated the System to FoundryVTT v10.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||

|
||||
[](https://ko-fi.com/vlyan)
|
||||
[](https://foundryvtt.com/)
|
||||
[](https://forge-vtt.com/bazaar#package=l5r5e)
|
||||
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
||||
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
||||
|
||||
@@ -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