diff --git a/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs b/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs index 97042ed8..72a39261 100644 --- a/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs +++ b/uSync.Core/Serialization/Serializers/ContentSerializerBase.cs @@ -256,12 +256,12 @@ protected virtual XElement SerializeProperties(TObject item, SyncSerializerOptio validNode = true; } - if (validNode) - { - valueNode.Add(new XCData(GetExportValue(GetPropertyValue(value), property.PropertyType, value.Culture, value.Segment))); - elements.Add(valueNode); - } + if (validNode) + { + valueNode.Add(new XCData(GetExportValue(GetPropertyValue(item, value, options), property.PropertyType, value.Culture!, value.Segment!))); + elements.Add(valueNode); } + } if (includeDefaults) @@ -303,9 +303,13 @@ protected virtual XElement SerializeProperties(TObject item, SyncSerializerOptio return node; } - // allows us to switch between published / edited easier. - protected virtual object GetPropertyValue(IPropertyValue value) - => value.EditedValue; + // allows us to switch between published / edited easier. + protected virtual object GetPropertyValue(TObject content, IPropertyValue value, SyncSerializerOptions options) + => value.EditedValue; + + [Obsolete("Use Get Property value with content and options, will be removed in v17")] + protected virtual object GetPropertyValue(IPropertyValue value) + => value.EditedValue; protected override SyncAttempt CanDeserialize(XElement node, SyncSerializerOptions options) {