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

|

|
||||||
[](https://ko-fi.com/vlyan)
|
[](https://ko-fi.com/vlyan)
|
||||||
|
[](https://foundryvtt.com/)
|
||||||
[](https://forge-vtt.com/bazaar#package=l5r5e)
|
[](https://forge-vtt.com/bazaar#package=l5r5e)
|
||||||
[](https://www.foundryvtt-hub.com/package/l5r5e/)
|
[](https://www.foundryvtt-hub.com/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
|
// New id
|
||||||
if (newId) {
|
if (newId || !item._id) {
|
||||||
item._id = foundry.utils.randomID();
|
// 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
|
// Copy the parent permission to the sub item
|
||||||
|
|||||||
Reference in New Issue
Block a user