U4-6034 - issue when renaming tabs
This commit is contained in:
@@ -391,16 +391,21 @@ namespace umbraco.controls
|
||||
}
|
||||
}
|
||||
|
||||
var tabs = SaveTabs();
|
||||
var tabs = SaveTabs(); // returns { TabId, TabName, TabSortOrder }
|
||||
foreach (var tab in tabs)
|
||||
{
|
||||
if (_contentType.ContentTypeItem.PropertyGroups.Contains(tab.Item2))
|
||||
var group = _contentType.ContentTypeItem.PropertyGroups.FirstOrDefault(x => x.Id == tab.Item1);
|
||||
if (group == null)
|
||||
{
|
||||
_contentType.ContentTypeItem.PropertyGroups[tab.Item2].SortOrder = tab.Item3;
|
||||
// creating a group
|
||||
group = new PropertyGroup {Id = tab.Item1, Name = tab.Item2, SortOrder = tab.Item3};
|
||||
_contentType.ContentTypeItem.PropertyGroups.Add(group);
|
||||
}
|
||||
else
|
||||
{
|
||||
_contentType.ContentTypeItem.PropertyGroups.Add(new PropertyGroup {Id = tab.Item1, Name = tab.Item2, SortOrder = tab.Item3});
|
||||
// updating an existing group
|
||||
group.Name = tab.Item2;
|
||||
group.SortOrder = tab.Item3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user