Add some logging to the cancelled event

This commit is contained in:
Sebastiaan Janssen
2014-08-18 18:02:35 +02:00
parent 65a2b79189
commit 14cbef5edf
2 changed files with 4 additions and 3 deletions

View File

@@ -382,6 +382,7 @@ namespace Umbraco.Core.Services
if (CreatingPartialView.IsRaisedEventCancelled(new NewEventArgs<PartialView>(partialView, true, partialView.Alias, -1), this))
{
LogHelper.Info<FileService>(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>(partialView, false, partialView.Alias, -1), this);
return partialView;
@@ -435,6 +435,7 @@ namespace Umbraco.Core.Services
if (DeletingPartialView.IsRaisedEventCancelled(new DeleteEventArgs<PartialView>(partialView), this))
{
LogHelper.Info<FileService>(string.Format("Deleting Partial View {0} was cancelled by an event handler.", partialViewsFileSystem.GetFullPath(partialView.FileName)));
return false;
}

View File

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