From d607041ca49fa9c2a5bca1ba9dbf6fb44ede2d9d Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 23 Apr 2015 14:55:57 +0200 Subject: [PATCH] U4-6450 Creating Partial View Macro without 'Create Macro' selected still tries to create a macro #U4-6450 Fixed --- .../umbraco/create/PartialViewTasksBase.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs index 793a4e3e07..cd9a2fcc26 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs @@ -64,7 +64,9 @@ namespace umbraco { var attempt = fileService.CreatePartialViewMacro(model, /*ParentID == 1,*/ snippetName, User.Id); - if (attempt) + // if ParentId = 0 then that means that the "Create macro" checkbox was OFF, so don't try to create an actual macro + // See PartialViewMacro.ascx.cs and PartialView.ascx.cs: SubmitButton_Click + if (attempt && ParentID != 0) { //The partial view path to be saved with the macro must be a fully qualified virtual path var virtualPath = string.Format("{0}/{1}/{2}", SystemDirectories.MvcViews, "MacroPartials", attempt.Result.Path);