Fixes: U4-3610 When adding another tab to a member type no members will load and result in a YSOD

Conflicts:
	src/Umbraco.Core/Persistence/Relators/PropertyTypePropertyGroupRelator.cs
This commit is contained in:
Shannon
2013-11-20 16:59:41 +11:00
parent 99ae94a82f
commit b13c3aa3b9

View File

@@ -19,11 +19,17 @@ namespace Umbraco.Core.Persistence.Relators
// Is this the same MemberTypeReadOnlyDto as the current one we're processing
if (Current != null && Current.UniqueId == a.UniqueId)
{
// Yes, just add this PropertyTypeReadOnlyDto to the current MemberTypeReadOnlyDto's collection
Current.PropertyTypes.Add(p);
//This property may already be added so we need to check for that
if (p.Id.HasValue && Current.PropertyTypes.Any(x => x.Id == p.Id.Value) == false)
{
// Add this PropertyTypeReadOnlyDto to the current MemberTypeReadOnlyDto's collection
Current.PropertyTypes.Add(p);
}
if (g.Id.HasValue && Current.PropertyTypeGroups != null && Current.PropertyTypeGroups.Any(x => x.Id == g.Id.Value) == false)
{
Current.PropertyTypeGroups.Add(g);
}
// Return null to indicate we're not done with this MemberTypeReadOnlyDto yet
return null;
@@ -46,7 +52,9 @@ namespace Umbraco.Core.Persistence.Relators
Current.PropertyTypeGroups = new List<PropertyTypeGroupReadOnlyDto>();
if (g.Id.HasValue)
{
Current.PropertyTypeGroups.Add(g);
}
// Return the now populated previous MemberTypeReadOnlyDto (or null if first time through)
return prev;