diff --git a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs index 92ac5a55ba..0e35cb956d 100644 --- a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs @@ -108,7 +108,13 @@ namespace Umbraco.Core.Persistence.Factories }; if (tabId != default(int)) + { propertyTypeDto.PropertyTypeGroupId = tabId; + } + else + { + propertyTypeDto.PropertyTypeGroupId = null; + } if (propertyType.HasIdentity) propertyTypeDto.Id = propertyType.Id; diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs index db3b846851..ca52678b91 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs @@ -255,9 +255,11 @@ namespace Umbraco.Core.Persistence.Repositories propertyGroup.Id = groupPrimaryKey; //Set Id on new PropertyGroup //Ensure that the PropertyGroup's Id is set on the PropertyTypes within a group + //unless the PropertyGroupId has already been changed. foreach (var propertyType in propertyGroup.PropertyTypes) { - propertyType.PropertyGroupId = propertyGroup.Id; + if(propertyType.IsPropertyDirty("PropertyGroupId") == false) + propertyType.PropertyGroupId = propertyGroup.Id; } }