diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/PublishContentTask.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/PublishContentTask.cs index 18aefa55804..22f176408e9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/PublishContentTask.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Workflows/Activities/PublishContentTask.cs @@ -33,7 +33,7 @@ public override async Task ExecuteAsync(WorkflowExecuti var content = (await GetContentAsync(workflowContext)) ?? throw new InvalidOperationException($"The '{nameof(PublishContentTask)}' failed to retrieve the content item."); - if (string.Equals(InlineEvent.ContentItemId, content.ContentItem.ContentItemId, StringComparison.OrdinalIgnoreCase)) + if (!content.HasDraft()) { return Outcomes("Noop"); } diff --git a/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs b/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs index 4128ec4aa02..a41c5f8d1ce 100644 --- a/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs +++ b/src/OrchardCore/OrchardCore.ContentManagement/DefaultContentManager.cs @@ -567,6 +567,7 @@ public async Task CreateAsync(ContentItem contentItem, VersionOptions options = if (options.IsDraft) { contentItem.Published = false; + contentItem.Latest = true; } // Build a context with the initialized instance to create