diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs
index c1c8e3270c..2398a6c2e6 100644
--- a/src/Umbraco.Core/Models/ContentTypeBase.cs
+++ b/src/Umbraco.Core/Models/ContentTypeBase.cs
@@ -533,6 +533,18 @@ namespace Umbraco.Core.Models
/// Name of the to remove
public void RemovePropertyGroup(string propertyGroupName)
{
+ // if no group exists with that name, do nothing
+ var group = PropertyGroups[propertyGroupName];
+ if (group == null) return;
+
+ // re-assign the group's properties to no group
+ foreach (var property in group.PropertyTypes)
+ {
+ property.PropertyGroupId = new Lazy(() => 0);
+ _propertyTypes.Add(property);
+ }
+
+ // actually remove the group
PropertyGroups.RemoveItem(propertyGroupName);
OnPropertyChanged(PropertyGroupCollectionSelector);
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs
index eed2947b23..44b4da1864 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs
@@ -1475,7 +1475,8 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }});
var propertyGroup = _contentType.ContentTypeItem.PropertyGroups.FirstOrDefault(x => x.Id == propertyGroupId);
if (propertyGroup != null && string.IsNullOrEmpty(propertyGroup.Name) == false)
{
- _contentType.ContentTypeItem.PropertyGroups.Remove(propertyGroup.Name);
+ // use RemovePropertyGroup so properties become generic
+ _contentType.ContentTypeItem.RemovePropertyGroup(propertyGroup.Name);
_contentType.Save();
}
//}