Skip to content

Commit 9ad67e2

Browse files
committed
Fixed test by moving when the publishing notification is fired.
1 parent bda23c3 commit 9ad67e2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Umbraco.Core/Services/ContentService.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,14 +1188,6 @@ public PublishResult Publish(IContent content, string[] cultures, int userId = C
11881188

11891189
var allLangs = _languageRepository.GetMany().ToList();
11901190

1191-
// Change state to publishing
1192-
content.PublishedState = PublishedState.Publishing;
1193-
var publishingNotification = new ContentPublishingNotification(content, evtMsgs);
1194-
if (scope.Notifications.PublishCancelable(publishingNotification))
1195-
{
1196-
return new PublishResult(PublishResultType.FailedPublishCancelledByEvent, evtMsgs, content);
1197-
}
1198-
11991191
// this will create the correct culture impact even if culture is * or null
12001192
IEnumerable<CultureImpact?> impacts =
12011193
cultures.Select(culture => _cultureImpactFactory.Create(culture, IsDefaultCulture(allLangs, culture), content));
@@ -1207,6 +1199,14 @@ public PublishResult Publish(IContent content, string[] cultures, int userId = C
12071199
content.PublishCulture(impact);
12081200
}
12091201

1202+
// Change state to publishing
1203+
content.PublishedState = PublishedState.Publishing;
1204+
var publishingNotification = new ContentPublishingNotification(content, evtMsgs);
1205+
if (scope.Notifications.PublishCancelable(publishingNotification))
1206+
{
1207+
return new PublishResult(PublishResultType.FailedPublishCancelledByEvent, evtMsgs, content);
1208+
}
1209+
12101210
PublishResult result = CommitDocumentChangesInternal(scope, content, evtMsgs, allLangs, publishingNotification.State, userId);
12111211
scope.Complete();
12121212
return result;

0 commit comments

Comments
 (0)