From 1b66c24258e1b14e03fecbff0323136298628814 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Thu, 4 Jun 2026 23:25:11 +0200 Subject: [PATCH] fix(sheets): use foundry.utils.duplicate instead of global duplicate Foundry V11+ no longer exposes 'duplicate' as a global function. It must be accessed via foundry.utils.duplicate. Fixed in: - actor-sheet.mjs:140 - creature-sheet.mjs:148 This resolves the ReferenceError: duplicate is not defined error when creating items on actor sheets. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- module/sheets/actor-sheet.mjs | 2 +- module/sheets/creature-sheet.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/sheets/actor-sheet.mjs b/module/sheets/actor-sheet.mjs index 72b5bf2..0673be3 100644 --- a/module/sheets/actor-sheet.mjs +++ b/module/sheets/actor-sheet.mjs @@ -137,7 +137,7 @@ export class VermineActorSheet extends ActorSheet { // Get the type of item to create. const type = header.dataset.type; // Grab any data associated with this control. - const data = duplicate(header.dataset); + const data = foundry.utils.duplicate(header.dataset); // Initialize a default name. // const name = `New ${type.capitalize()}`; const name = game.i18n.localize('ITEMS.new_' + type); diff --git a/module/sheets/creature-sheet.mjs b/module/sheets/creature-sheet.mjs index 7d5fa23..430f194 100644 --- a/module/sheets/creature-sheet.mjs +++ b/module/sheets/creature-sheet.mjs @@ -145,7 +145,7 @@ export class VermineCreatureSheet extends VermineActorSheet { // Get the type of item to create. const type = header.dataset.type; // Grab any data associated with this control. - const data = duplicate(header.dataset); + const data = foundry.utils.duplicate(header.dataset); // Initialize a default name. // const name = `New ${type.capitalize()}`; const name = game.i18n.localize('ITEMS.new_' + type);