diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs index 03222b9cf..8f80b5749 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/MongoContentRepository_SnapshotStore.cs @@ -95,6 +95,10 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents { var content = CreateContent(value, value.Data, newVersion); + content.NewStatus = value.NewStatus; + content.ScheduledAt = value.ScheduleJob?.DueTime; + content.ScheduleJob = value.ScheduleJob; + await collectionAll.UpsertVersionedAsync(content.DocumentId, oldVersion, content); } @@ -102,6 +106,10 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents { var content = CreateContent(value, value.CurrentVersion.Data, newVersion); + content.NewStatus = null; + content.ScheduledAt = null; + content.ScheduleJob = null; + await collectionPublished.UpsertVersionedAsync(content.DocumentId, oldVersion, content); } @@ -113,9 +121,6 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents content.DocumentId = value.UniqueId; content.IndexedAppId = value.AppId.Id; content.IndexedSchemaId = value.SchemaId.Id; - content.NewStatus = null; - content.ScheduledAt = null; - content.ScheduleJob = null; content.Version = newVersion; return content; diff --git a/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs b/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs index 2038c4bcf..b7e2b4102 100644 --- a/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs +++ b/backend/tools/TestSuite/TestSuite.ApiTests/ContentUpdateTests.cs @@ -435,12 +435,14 @@ namespace TestSuite.ApiTests var updated = await _.Contents.GetAsync(content.Id); Assert.Equal(1, updated.Data.Number); + Assert.Null(updated.NewStatus); // STEP 4: Get the unpublished version var unpublished = await _.Contents.GetAsync(content.Id, QueryContext.Default.Unpublished()); Assert.Equal(2, unpublished.Data.Number); + Assert.Equal("Draft", unpublished.NewStatus); } finally {