Removed obsolete property from User

This commit is contained in:
Zeegaan
2021-08-19 08:47:32 +02:00
parent 7b68083aff
commit b1d11fca64
4 changed files with 1 additions and 70 deletions

View File

@@ -46,21 +46,5 @@ namespace Umbraco.Cms.Core.Models.Membership
/// A Json blob stored for recording tour data for a user
/// </summary>
string TourData { get; set; }
/// <summary>
/// Returns an item from the user instance's cache
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="cacheKey"></param>
/// <returns></returns>
T FromUserCache<T>(string cacheKey) where T : class;
/// <summary>
/// Puts an item in the user instance's cache
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="cacheKey"></param>
/// <param name="vals"></param>
void ToUserCache<T>(string cacheKey, T vals) where T : class;
}
}

View File

@@ -366,41 +366,6 @@ namespace Umbraco.Cms.Core.Models.Membership
}
}
public T FromUserCache<T>(string cacheKey)
where T : class
{
lock (_additionalDataLock)
{
return AdditionalData.TryGetValue(cacheKey, out var data)
? data as T
: null;
}
}
public void ToUserCache<T>(string cacheKey, T vals)
where T : class
{
lock (_additionalDataLock)
{
AdditionalData[cacheKey] = vals;
}
}
[IgnoreDataMember]
[DoNotClone]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This should not be used, it's currently used for only a single edge case - should probably be removed for netcore")]
internal IDictionary<string, object> AdditionalData
{
get
{
lock (_additionalDataLock)
{
return _additionalData ?? (_additionalData = new Dictionary<string, object>());
}
}
}
protected override void PerformDeepClone(object clone)
{
base.PerformDeepClone(clone);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Models.Membership;
@@ -38,13 +38,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Factories
user.InvitedDate = dto.InvitedDate;
user.TourData = dto.TourData;
// we should never get user with ID zero from database, except
// when upgrading from v7 - mark that user so that we do not
// save it back to database (as that would create a *new* user)
// see also: UserRepository.PersistNewItem
if (dto.Id == 0)
user.ToUserCache<string>("IS_V7_ZERO", "true");
// reset dirty initial properties (U4-1946)
user.ResetDirtyProperties(false);

View File

@@ -444,17 +444,6 @@ ORDER BY colName";
protected override void PersistNewItem(IUser entity)
{
// the use may have no identity, ie ID is zero, and be v7 super
// user - then it has been marked - and we must not persist it
// as new, as we do not want to create a new user - instead, persist
// it as updated
// see also: UserFactory.BuildEntity
if (entity.FromUserCache<string>("IS_V7_ZERO") != null)
{
PersistUpdatedItem(entity);
return;
}
entity.AddingEntity();
// ensure security stamp if missing