Skip to content

Commit

Permalink
serialize the creation date (will be a format change)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Jump committed Dec 18, 2019
1 parent 1a17425 commit 9fa9597
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions uSync8.ContentEdition/Serializers/ContentSerializerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ protected virtual XElement SerializeInfo(TObject item)
info.Add(new XElement("Path", GetItemPath(item)));
info.Add(new XElement("Trashed", item.Trashed));
info.Add(new XElement("ContentType", item.ContentType.Alias));
info.Add(new XElement("CreateDate", item.CreateDate));

var title = new XElement("NodeName", new XAttribute("Default", item.Name));
foreach (var culture in item.AvailableCultures)
Expand Down Expand Up @@ -166,6 +167,10 @@ protected virtual Attempt<string> DeserializeBase(TObject item, XElement node)
if (key != Guid.Empty && item.Key != key)
item.Key = key;

var createDate = info.Element("CreateDate").ValueOrDefault(item.CreateDate);
if (item.CreateDate != createDate)
item.CreateDate = createDate;

DeserializeName(item, node);

return Attempt.Succeed("Info Deserialized");
Expand Down
1 change: 1 addition & 0 deletions uSync8.ContentEdition/Tracker/ContentBaseTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ protected override TrackedItem TrackChanges()
new TrackedItem("Path", "/Path", true),
new TrackedItem("SortOrder", "/SortOrder", true),
new TrackedItem("ContentType", "/ContentType", true),
new TrackedItem("CreateDate", "/CreateDate", true),

new TrackedItem("Name", "/NodeName", false)
{
Expand Down
1 change: 1 addition & 0 deletions uSync8.ContentEdition/Tracker/ContentTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ protected override TrackedItem TrackChanges()
new TrackedItem("SortOrder", "/SortOrder", true),
new TrackedItem("FileHash", "/FileHash", true),
new TrackedItem("Template", "/Template", true),
new TrackedItem("CreateDate", "/CreateDate", true),

new TrackedItem("Name", "/NodeName", false)
{
Expand Down

0 comments on commit 9fa9597

Please sign in to comment.