Fixes U4-1798 by adding the current user's id when saving Media, MediaTypes and DocumentTypes.

This commit is contained in:
Morten Christensen
2013-02-28 09:37:33 -01:00
parent 836a99128f
commit ecae9c47b7
3 changed files with 10 additions and 3 deletions

View File

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

View File

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

View File

@@ -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.