Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrch committed Jul 14, 2024
1 parent 73ba959 commit b20b328
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -125,13 +127,18 @@ protected override IEnumerable<IUmtModel> 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<IDateTimeNowService>().GetDateTimeNow())
{
versionStatus = VersionStatus.Unpublished;
}

string? contentItemCommonDataPageBuilderWidgets = null;
string? contentItemCommonDataPageTemplateConfiguration = null;
switch (cmsDocument)
Expand Down

0 comments on commit b20b328

Please sign in to comment.