Fixes cache refreshing for user groups since user cache need to be cleared for that too. Updates cache refreshers to use json.net for serializing which is way faster. adds better support for querying multiple user groups and entity ids for permissions, updates tests
This commit is contained in:
@@ -11,6 +11,7 @@ using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using umbraco.interfaces;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Web.PublishedCache.XmlPublishedCache;
|
||||
|
||||
namespace Umbraco.Web.Cache
|
||||
@@ -32,8 +33,7 @@ namespace Umbraco.Web.Cache
|
||||
/// <returns></returns>
|
||||
public static JsonPayload[] DeserializeFromJsonPayload(string json)
|
||||
{
|
||||
var serializer = new JavaScriptSerializer();
|
||||
var jsonObject = serializer.Deserialize<JsonPayload[]>(json);
|
||||
var jsonObject = JsonConvert.DeserializeObject<JsonPayload[]>(json);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@@ -45,34 +45,31 @@ namespace Umbraco.Web.Cache
|
||||
/// <returns></returns>
|
||||
internal static string SerializeToJsonPayload(OperationType operation, params IMedia[] media)
|
||||
{
|
||||
var serializer = new JavaScriptSerializer();
|
||||
var items = media.Select(x => FromMedia(x, operation)).ToArray();
|
||||
var json = serializer.Serialize(items);
|
||||
var json = JsonConvert.SerializeObject(items);
|
||||
return json;
|
||||
}
|
||||
|
||||
internal static string SerializeToJsonPayloadForMoving(OperationType operation, MoveEventInfo<IMedia>[] media)
|
||||
{
|
||||
var serializer = new JavaScriptSerializer();
|
||||
var items = media.Select(x => new JsonPayload
|
||||
{
|
||||
Id = x.Entity.Id,
|
||||
Operation = operation,
|
||||
Path = x.OriginalPath
|
||||
}).ToArray();
|
||||
var json = serializer.Serialize(items);
|
||||
var json = JsonConvert.SerializeObject(items);
|
||||
return json;
|
||||
}
|
||||
|
||||
internal static string SerializeToJsonPayloadForPermanentDeletion(params int[] mediaIds)
|
||||
{
|
||||
var serializer = new JavaScriptSerializer();
|
||||
var items = mediaIds.Select(x => new JsonPayload
|
||||
{
|
||||
Id = x,
|
||||
Operation = OperationType.Deleted
|
||||
}).ToArray();
|
||||
var json = serializer.Serialize(items);
|
||||
var json = JsonConvert.SerializeObject(items);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user