Skip to content

Commit

Permalink
Ensure snew scheduled items have an empty guid.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Jump committed Jul 14, 2020
1 parent 600c45b commit f55a4aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions uSync8.ContentEdition/Serializers/ContentSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web.WebPages;
using System.Xml.Linq;

using NPoco.Expressions;

using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
Expand Down Expand Up @@ -184,8 +188,10 @@ private void DeserializeSchedules(IContent item, XElement node, SyncSerializerOp
foreach (var schedule in schedules.Elements("ContentSchedule"))
{
var importSchedule = GetContentScheduleFromNode(schedule);
logger.Debug<ContentSerializer>("Schedule: {action} {culture} {date}", importSchedule.Action, importSchedule.Culture, importSchedule.Date);

if (importSchedule.Date < DateTime.Now) continue; // don't add schedules in the past
if (importSchedule.Date < DateTime.Now)
continue; // don't add schedules in the past

nodeSchedules.Add(importSchedule);

Expand All @@ -210,7 +216,7 @@ private void DeserializeSchedules(IContent item, XElement node, SyncSerializerOp

private ContentSchedule GetContentScheduleFromNode(XElement scheduleNode)
{
var key = scheduleNode.Attribute("Key").ValueOrDefault(Guid.Empty);
var key = Guid.Empty;
var culture = scheduleNode.Element("Culture").ValueOrDefault(string.Empty);
var date = scheduleNode.Element("Date").ValueOrDefault(DateTime.MinValue);
var action = scheduleNode.Element("Action").ValueOrDefault(ContentScheduleAction.Release);
Expand Down

0 comments on commit f55a4aa

Please sign in to comment.