Fixes U4-1814 for Document and Media by adding both legacy Before/After Move events

This commit is contained in:
Morten Christensen
2013-03-03 11:19:15 -01:00
parent 0cafeac6eb
commit d497659f1f
2 changed files with 22 additions and 6 deletions

View File

@@ -230,9 +230,17 @@ namespace umbraco.cms.businesslogic.media
/// </summary>
public override void Move(int newParentId)
{
var current = User.GetCurrent();
int userId = current == null ? 0 : current.Id;
ApplicationContext.Current.Services.MediaService.Move(MediaItem, newParentId, userId);
MoveEventArgs e = new MoveEventArgs();
base.FireBeforeMove(e);
if (!e.Cancel)
{
var current = User.GetCurrent();
int userId = current == null ? 0 : current.Id;
ApplicationContext.Current.Services.MediaService.Move(MediaItem, newParentId, userId);
}
base.FireAfterMove(e);
}
/// <summary>

View File

@@ -1010,9 +1010,17 @@ namespace umbraco.cms.businesslogic.web
/// </summary>
public override void Move(int newParentId)
{
var current = User.GetCurrent();
int userId = current == null ? 0 : current.Id;
ApplicationContext.Current.Services.ContentService.Move(Content, newParentId, userId);
MoveEventArgs e = new MoveEventArgs();
base.FireBeforeMove(e);
if (!e.Cancel)
{
var current = User.GetCurrent();
int userId = current == null ? 0 : current.Id;
ApplicationContext.Current.Services.ContentService.Move(Content, newParentId, userId);
}
base.FireAfterMove(e);
}
/// <summary>