From e62de9561bdbf87db1a8e7a7e41b10cda770bf82 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Mon, 11 Feb 2019 07:54:39 +0100 Subject: [PATCH] #4466 - Sets the MacroType when created from Partial View Macro Files snippets --- src/Umbraco.Web/Editors/MacroRenderingController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/MacroRenderingController.cs b/src/Umbraco.Web/Editors/MacroRenderingController.cs index 3cd2e86dd8..49b58416cd 100644 --- a/src/Umbraco.Web/Editors/MacroRenderingController.cs +++ b/src/Umbraco.Web/Editors/MacroRenderingController.cs @@ -124,7 +124,7 @@ namespace Umbraco.Web.Editors // When rendering the macro in the backoffice the default setting would be to use the Culture of the logged in user. // Since a Macro might contain thing thats related to the culture of the "IPublishedContent" (ie Dictionary keys) we want // to set the current culture to the culture related to the content item. This is hacky but it works. - + var culture = publishedContent.GetCulture(); _variationContextAccessor.VariationContext = new VariationContext(); //must have an active variation context! if (culture != null) @@ -156,7 +156,8 @@ namespace Umbraco.Web.Editors { Alias = macroName.ToSafeAlias(), Name = macroName, - MacroSource = model.VirtualPath.EnsureStartsWith("~") + MacroSource = model.VirtualPath.EnsureStartsWith("~"), + MacroType = MacroTypes.PartialView }; _macroService.Save(macro); // may throw