Fix up to Macros in Core project

This commit is contained in:
Nikolaj Geisle
2022-01-13 09:27:37 +01:00
parent 521023372b
commit b6d5465b49
110 changed files with 537 additions and 451 deletions

View File

@@ -34,9 +34,9 @@ namespace Umbraco.Cms.Core.Cache
{
ClearAllIsolatedCacheByEntityType<IUserGroup>();
var userGroupCache = AppCaches.IsolatedCaches.Get<IUserGroup>();
if (userGroupCache)
if (userGroupCache.Success.HasValue && userGroupCache.Success.Value)
{
userGroupCache.Result.ClearByKey(CacheKeys.UserGroupGetByAliasCacheKeyPrefix);
userGroupCache.Result?.ClearByKey(CacheKeys.UserGroupGetByAliasCacheKeyPrefix);
}
//We'll need to clear all user cache too
@@ -54,10 +54,10 @@ namespace Umbraco.Cms.Core.Cache
public override void Remove(int id)
{
var userGroupCache = AppCaches.IsolatedCaches.Get<IUserGroup>();
if (userGroupCache)
if (userGroupCache.Success.HasValue && userGroupCache.Success.Value)
{
userGroupCache.Result.Clear(RepositoryCacheKeys.GetKey<IUserGroup, int>(id));
userGroupCache.Result.ClearByKey(CacheKeys.UserGroupGetByAliasCacheKeyPrefix);
userGroupCache.Result?.Clear(RepositoryCacheKeys.GetKey<IUserGroup, int>(id));
userGroupCache.Result?.ClearByKey(CacheKeys.UserGroupGetByAliasCacheKeyPrefix);
}
//we don't know what user's belong to this group without doing a look up so we'll need to just clear them all