Merge pull request #227 from mattbrailsford/6.2.0-3454
Maintains tab sort order for doc type imports/exports.
This commit is contained in:
@@ -586,9 +586,18 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
var id = tab.Element("Id").Value;//Do we need to use this for tracking?
|
||||
var caption = tab.Element("Caption").Value;
|
||||
|
||||
if (contentType.PropertyGroups.Contains(caption) == false)
|
||||
{
|
||||
contentType.AddPropertyGroup(caption);
|
||||
|
||||
int sortOrder;
|
||||
if(tab.Element("SortOrder") != null &&
|
||||
int.TryParse(tab.Element("SortOrder").Value, out sortOrder))
|
||||
{
|
||||
// Override the sort order with the imported value
|
||||
contentType.PropertyGroups[caption].SortOrder = sortOrder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,6 +547,7 @@ namespace umbraco.cms.businesslogic.web
|
||||
var tabx = xd.CreateElement("Tab");
|
||||
tabx.AppendChild(XmlHelper.AddTextNode(xd, "Id", propertyTypeGroup.Id.ToString()));
|
||||
tabx.AppendChild(XmlHelper.AddTextNode(xd, "Caption", propertyTypeGroup.Name));
|
||||
tabx.AppendChild(XmlHelper.AddTextNode(xd, "SortOrder", propertyTypeGroup.SortOrder.ToString()));
|
||||
tabs.AppendChild(tabx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user