diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index fb98a8ff88..dd61585203 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1188,14 +1188,6 @@ public class ContentService : RepositoryService, IContentService var allLangs = _languageRepository.GetMany().ToList(); - // Change state to publishing - content.PublishedState = PublishedState.Publishing; - var publishingNotification = new ContentPublishingNotification(content, evtMsgs); - if (scope.Notifications.PublishCancelable(publishingNotification)) - { - return new PublishResult(PublishResultType.FailedPublishCancelledByEvent, evtMsgs, content); - } - // this will create the correct culture impact even if culture is * or null IEnumerable impacts = cultures.Select(culture => _cultureImpactFactory.Create(culture, IsDefaultCulture(allLangs, culture), content)); @@ -1207,6 +1199,14 @@ public class ContentService : RepositoryService, IContentService content.PublishCulture(impact); } + // Change state to publishing + content.PublishedState = PublishedState.Publishing; + var publishingNotification = new ContentPublishingNotification(content, evtMsgs); + if (scope.Notifications.PublishCancelable(publishingNotification)) + { + return new PublishResult(PublishResultType.FailedPublishCancelledByEvent, evtMsgs, content); + } + PublishResult result = CommitDocumentChangesInternal(scope, content, evtMsgs, allLangs, publishingNotification.State, userId); scope.Complete(); return result;