From 37ae40be8b8f48cda30ad454e538b49da0a79d69 Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Sat, 24 Jan 2026 20:20:07 +0100 Subject: [PATCH] [Fix] Enriched Description IsOwner (#1577) * Fixed so that secrets are properly enriched for items * . --- module/applications/sheets-configs/action-base-config.mjs | 1 + module/applications/sheets/api/application-mixin.mjs | 2 +- module/data/item/base.mjs | 2 +- templates/sheets-settings/action-settings/base.hbs | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/applications/sheets-configs/action-base-config.mjs b/module/applications/sheets-configs/action-base-config.mjs index 7051ad2b..42252362 100644 --- a/module/applications/sheets-configs/action-base-config.mjs +++ b/module/applications/sheets-configs/action-base-config.mjs @@ -125,6 +125,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) async _prepareContext(_options) { const context = await super._prepareContext(_options, 'action'); context.source = this.action.toObject(true); + context.action = this.action; context.summons = []; for (const summon of context.source.summon ?? []) { diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index b590de86..3c0444eb 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -600,7 +600,7 @@ export default function DHApplicationMixin(Base) { { relativeTo: isAction ? doc.parent : doc, rollData: doc.getRollData?.(), - secrets: isAction ? doc.parent.isOwner : doc.isOwner + secrets: isAction ? doc.parent.parent.isOwner : doc.isOwner } ); } diff --git a/module/data/item/base.mjs b/module/data/item/base.mjs index 2399b7db..84f39103 100644 --- a/module/data/item/base.mjs +++ b/module/data/item/base.mjs @@ -147,7 +147,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel { return await foundry.applications.ux.TextEditor.implementation.enrichHTML(fullDescription, { relativeTo: this, rollData: this.getRollData(), - secrets: this.isOwner + secrets: this.parent.isOwner }); } diff --git a/templates/sheets-settings/action-settings/base.hbs b/templates/sheets-settings/action-settings/base.hbs index 65010903..95c3cc50 100644 --- a/templates/sheets-settings/action-settings/base.hbs +++ b/templates/sheets-settings/action-settings/base.hbs @@ -11,6 +11,6 @@
{{localize "DAGGERHEART.GENERAL.description"}} - {{formInput fields.description value=source.description enriched=source.description name="description" toggled=true }} + {{formInput fields.description value=source.description enriched=action.description name="description" toggled=true }}
\ No newline at end of file