Fixed test by moving when the publishing notification is fired.
This commit is contained in:
@@ -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<CultureImpact?> 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;
|
||||
|
||||
Reference in New Issue
Block a user