diff --git a/uSync.Core/Serialization/Serializers/ContentSerializer.cs b/uSync.Core/Serialization/Serializers/ContentSerializer.cs index 0f81bcfd..db583ff8 100644 --- a/uSync.Core/Serialization/Serializers/ContentSerializer.cs +++ b/uSync.Core/Serialization/Serializers/ContentSerializer.cs @@ -186,9 +186,12 @@ protected override SyncAttempt DeserializeCore(XElement node, SyncSeri details.AddRange(propertiesAttempt.Result); - // sort order - var sortOrder = node.Element("Info").Element("SortOrder").ValueOrDefault(-1); - details.AddNotNull(HandleSortOrder(item, sortOrder)); + if (!options.GetSetting("IgnoreSortOrder", false)) + { + // sort order + var sortOrder = node.Element("Info").Element("SortOrder").ValueOrDefault(-1); + details.AddNotNull(HandleSortOrder(item, sortOrder)); + } var publishTimer = Stopwatch.StartNew(); diff --git a/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs b/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs index c96b6359..9f44122d 100644 --- a/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs +++ b/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs @@ -169,7 +169,10 @@ protected virtual XElement SerializeInfo(TObject item, SyncSerializerOptions opt } info.Add(title); - info.Add(new XElement(uSyncConstants.Xml.SortOrder, item.SortOrder)); + if (!options.GetSetting("IgnoreSortOrder", false)) + { + info.Add(new XElement(uSyncConstants.Xml.SortOrder, item.SortOrder)); + } return info; } diff --git a/uSync.Core/Serialization/Serializers/MediaSerializer.cs b/uSync.Core/Serialization/Serializers/MediaSerializer.cs index 93b6f7e8..92d77ea0 100644 --- a/uSync.Core/Serialization/Serializers/MediaSerializer.cs +++ b/uSync.Core/Serialization/Serializers/MediaSerializer.cs @@ -74,8 +74,11 @@ protected override SyncAttempt DeserializeCore(XElement node, SyncSerial var info = node.Element("Info"); - var sortOrder = info.Element("SortOrder").ValueOrDefault(-1); - HandleSortOrder(item, sortOrder); + if (!options.GetSetting("IgnoreSortOrder", false)) + { + var sortOrder = info.Element("SortOrder").ValueOrDefault(-1); + HandleSortOrder(item, sortOrder); + } if (details.HasWarning() && options.FailOnWarnings())