From 14cbef5edf42f2b1963e4608395c3c8e6c3d210d Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 18 Aug 2014 18:02:35 +0200 Subject: [PATCH] Add some logging to the cancelled event --- src/Umbraco.Core/Services/FileService.cs | 5 +++-- .../umbraco/create/PartialViewTasksBase.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index bddbf04910..13a17c0ae8 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -382,6 +382,7 @@ namespace Umbraco.Core.Services if (CreatingPartialView.IsRaisedEventCancelled(new NewEventArgs(partialView, true, partialView.Alias, -1), this)) { + LogHelper.Info(string.Format("Creating Partial View {0} was cancelled by an event handler.", partialViewsFileSystem.GetFullPath(partialView.FileName))); partialView.SaveSucceeded = false; return partialView; } @@ -410,8 +411,7 @@ namespace Umbraco.Core.Services CreatePartialViewMacro(partialView); partialView.ReturnUrl = string.Format(partialView.EditViewFile + "?file={0}", HttpUtility.UrlEncode(relativeFilePath)); - - + CreatedPartialView.RaiseEvent(new NewEventArgs(partialView, false, partialView.Alias, -1), this); return partialView; @@ -435,6 +435,7 @@ namespace Umbraco.Core.Services if (DeletingPartialView.IsRaisedEventCancelled(new DeleteEventArgs(partialView), this)) { + LogHelper.Info(string.Format("Deleting Partial View {0} was cancelled by an event handler.", partialViewsFileSystem.GetFullPath(partialView.FileName))); return false; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs index 7a096bf35f..0353f306d7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs @@ -15,7 +15,7 @@ namespace umbraco [UmbracoWillObsolete("http://issues.umbraco.org/issue/U4-1373", "This will one day be removed when we overhaul the create process")] public abstract class PartialViewTasksBase : LegacyDialogTask { - private string _returnUrl = ""; + private string _returnUrl = string.Empty; public override string ReturnUrl { get { return _returnUrl; }