U4-6450 Creating Partial View Macro without 'Create Macro' selected still tries to create a macro

#U4-6450 Fixed
This commit is contained in:
Sebastiaan Janssen
2015-04-23 14:55:57 +02:00
parent b3daf7f55d
commit d607041ca4

View File

@@ -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);