From b20b328bd8d02e1d9ab06ce17af41d3fa411c280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Krch?= Date: Mon, 15 Jul 2024 01:56:38 +0200 Subject: [PATCH] WIP --- .../Mappers/ContentItemMapper.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)