U4-8569 Saving a member type changes the UniqueId of custom properties

This fixes the member property type UniqueID SQL and mapping.
This ensures that the main repositories fully assert/compare all fetched properties.
This commit is contained in:
Shannon
2016-06-07 12:20:10 +02:00
parent 111ef37bfb
commit 50f4bbdd1e
13 changed files with 147 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
@@ -155,6 +156,7 @@ namespace Umbraco.Core.Models
/// Language of the data contained within this Content object.
/// </summary>
[Obsolete("This is not used and will be removed from the codebase in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Language
{
get { return _language; }

View File

@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using Umbraco.Core.Persistence.Mappers;
@@ -21,6 +22,7 @@ namespace Umbraco.Core.Models
bool Published { get; }
[Obsolete("This will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
string Language { get; set; }
/// <summary>

View File

@@ -51,5 +51,8 @@ namespace Umbraco.Core.Models.Rdbms
[Column("dbType")]
public string DbType { get; set; }
[Column("UniqueID")]
public Guid UniqueId { get; set; }
}
}

View File

@@ -114,7 +114,8 @@ namespace Umbraco.Core.Persistence.Factories
ValidationRegExp = typeDto.ValidationRegExp,
PropertyGroupId = new Lazy<int>(() => tempGroupDto.Id.Value),
CreateDate = memberType.CreateDate,
UpdateDate = memberType.UpdateDate
UpdateDate = memberType.UpdateDate,
Key = typeDto.UniqueId
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
@@ -166,7 +167,8 @@ namespace Umbraco.Core.Persistence.Factories
ValidationRegExp = typeDto.ValidationRegExp,
PropertyGroupId = null,
CreateDate = dto.CreateDate,
UpdateDate = dto.CreateDate
UpdateDate = dto.CreateDate,
Key = typeDto.UniqueId
};
propertyTypes.Add(propertyType);

View File

@@ -94,7 +94,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
sql.Select("umbracoNode.*", "cmsContentType.*", "cmsPropertyType.id AS PropertyTypeId", "cmsPropertyType.Alias",
"cmsPropertyType.Name", "cmsPropertyType.Description", "cmsPropertyType.mandatory",
"cmsPropertyType.Name", "cmsPropertyType.Description", "cmsPropertyType.mandatory", "cmsPropertyType.UniqueID",
"cmsPropertyType.validationRegExp", "cmsPropertyType.dataTypeId", "cmsPropertyType.sortOrder AS PropertyTypeSortOrder",
"cmsPropertyType.propertyTypeGroupId AS PropertyTypesGroupId", "cmsMemberType.memberCanEdit", "cmsMemberType.viewOnProfile",
"cmsDataType.propertyEditorAlias", "cmsDataType.dbType", "cmsPropertyTypeGroup.id AS PropertyTypeGroupId",