Fix order of property group inserts

This commit is contained in:
Ronald Barendse
2021-06-17 09:12:56 +02:00
parent 5fd09b43f3
commit b87ead60d7
2 changed files with 3 additions and 3 deletions

View File

@@ -175,7 +175,7 @@ AND umbracoNode.nodeObjectType = @objectType",
}
//Insert Tabs
foreach (var propertyGroup in entity.PropertyGroups.OrderBy(g => g.Level))
foreach (var propertyGroup in entity.PropertyGroups.OrderBy(x => x.Level).ToArray())
{
var tabDto = PropertyGroupFactory.BuildGroupDto(propertyGroup, nodeDto.NodeId);
var primaryKey = Convert.ToInt32(Database.Insert(tabDto));
@@ -374,7 +374,7 @@ AND umbracoNode.id <> @id",
}
// insert or update groups, assign properties
foreach (var propertyGroup in entity.PropertyGroups.OrderBy(x => x.Level))
foreach (var propertyGroup in entity.PropertyGroups.OrderBy(x => x.Level).ToArray())
{
// insert or update group
var groupDto = PropertyGroupFactory.BuildGroupDto(propertyGroup, entity.Id);

View File

@@ -200,7 +200,7 @@ namespace Umbraco.Web.Models.Mapping
group.ParentTabContentTypeNames = parentGroups.SelectMany(x => x.ParentTabContentTypeNames).ToArray();
}
return groups.OrderBy(x => x.Level).ThenBy(x => x.SortOrder);
return groups.OrderBy(x => x.Level).ThenBy(x => x.SortOrder).ToArray();
}
private IEnumerable<TPropertyType> MapProperties(IEnumerable<PropertyType> properties, IContentTypeBase contentType, int groupId, bool inherited)