Fixes U4-1798 by adding the current user's id when saving Media, MediaTypes and DocumentTypes.
This commit is contained in:
@@ -251,7 +251,9 @@ namespace umbraco.cms.businesslogic.media
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
ApplicationContext.Current.Services.MediaService.Save(MediaItem);
|
||||
var current = User.GetCurrent();
|
||||
int userId = current == null ? 0 : current.Id;
|
||||
ApplicationContext.Current.Services.MediaService.Save(MediaItem, userId);
|
||||
|
||||
base.Save();
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Caching;
|
||||
using System.Linq;
|
||||
using umbraco.BusinessLogic;
|
||||
|
||||
namespace umbraco.cms.businesslogic.media
|
||||
{
|
||||
@@ -128,7 +129,9 @@ namespace umbraco.cms.businesslogic.media
|
||||
_mediaType.AddContentType(contentType);
|
||||
}
|
||||
|
||||
ApplicationContext.Current.Services.ContentTypeService.Save(_mediaType);
|
||||
var current = User.GetCurrent();
|
||||
int userId = current == null ? 0 : current.Id;
|
||||
ApplicationContext.Current.Services.ContentTypeService.Save(_mediaType, userId);
|
||||
|
||||
//Ensure that MediaTypes are reloaded from db by clearing cache
|
||||
InMemoryCacheProvider.Current.Clear();
|
||||
|
||||
@@ -453,7 +453,9 @@ namespace umbraco.cms.businesslogic.web
|
||||
_contentType.AddContentType(contentType);
|
||||
}
|
||||
|
||||
ApplicationContext.Current.Services.ContentTypeService.Save(_contentType);
|
||||
var current = User.GetCurrent();
|
||||
int userId = current == null ? 0 : current.Id;
|
||||
ApplicationContext.Current.Services.ContentTypeService.Save(_contentType, userId);
|
||||
|
||||
//Ensure that DocumentTypes are reloaded from db by clearing cache.
|
||||
//NOTE Would be nice if we could clear cache by type instead of emptying the entire cache.
|
||||
|
||||
Reference in New Issue
Block a user