From 89989d60ce9fd1f4f49714ea823d025a61695254 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Mon, 10 Nov 2025 12:00:43 +0100 Subject: [PATCH] Templates: Fix "Discard changes?" dialog after creating template with master template (fixes #20262) (#20749) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moves the _data.updateCurrent() call inside the updateLayoutBlock conditional in setMasterTemplate(). This prevents spurious change detection when loading templates from the server, while maintaining proper change tracking when users actually modify the master template via the UI. This completes the fix started in PR #20529 which added the updateLayoutBlock parameter but inadvertently left the data model update outside the conditional. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude --- .../templates/workspace/template-workspace.context.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts index 0ea8f97d8c..0951d51f30 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts @@ -123,10 +123,9 @@ export class UmbTemplateWorkspaceContext if (updateLayoutBlock) { this.#updateMasterTemplateLayoutBlock(); + this._data.updateCurrent({ masterTemplate: unique ? { unique } : null }); } - this._data.updateCurrent({ masterTemplate: unique ? { unique } : null }); - return unique; }