diff --git a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs index 9923daa7..fae5bcbf 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs @@ -3,6 +3,8 @@ namespace Migration.Toolkit.Source.Mappers; using System.Diagnostics; using CMS.ContentEngine; using CMS.ContentEngine.Internal; +using CMS.Core; +using CMS.Core.Internal; using CMS.FormEngine; using CMS.MediaLibrary; using CMS.Websites; @@ -125,13 +127,18 @@ protected override IEnumerable MapInternal(CmsTreeMapperSource source var versionStatus = cmsDocument switch { - { DocumentIsArchived: true } => VersionStatus.Archived, + { DocumentIsArchived: true } => VersionStatus.Unpublished, { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: null } => VersionStatus.Published, { DocumentPublishedVersionHistoryID: { } pubId, DocumentCheckedOutVersionHistoryID: { } chId } when pubId <= chId => VersionStatus.Published, { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: not null } => VersionStatus.InitialDraft, _ => draftMigrated ? VersionStatus.Published : VersionStatus.InitialDraft }; + if (cmsDocument.DocumentPublishTo < Service.Resolve().GetDateTimeNow()) + { + versionStatus = VersionStatus.Unpublished; + } + string? contentItemCommonDataPageBuilderWidgets = null; string? contentItemCommonDataPageTemplateConfiguration = null; switch (cmsDocument)