Add notification flag to indicate the current publish operation includes descendants (#13145)

This commit is contained in:
Arkadiusz Biel
2023-05-31 16:33:23 +01:00
committed by GitHub
parent 676efb9f89
commit 9bafdbd992
2 changed files with 6 additions and 3 deletions

View File

@@ -21,8 +21,11 @@ public sealed class ContentPublishedNotification : EnumerableObjectNotification<
{
}
/// <summary>
/// Gets a enumeration of <see cref="IContent"/> with the published entities.
public ContentPublishedNotification(IEnumerable<IContent> target, EventMessages messages, bool includeDescendants)
: base(target, messages) => IncludeDescendants = includeDescendants;
/// </summary>
public IEnumerable<IContent> PublishedEntities => Target;
public bool IncludeDescendants { get; set; }
}

View File

@@ -2164,7 +2164,7 @@ public class ContentService : RepositoryService, IContentService
// (SaveAndPublishBranchOne does *not* do it)
scope.Notifications.Publish(
new ContentTreeChangeNotification(document, TreeChangeTypes.RefreshBranch, eventMessages));
scope.Notifications.Publish(new ContentPublishedNotification(publishedDocuments, eventMessages));
scope.Notifications.Publish(new ContentPublishedNotification(publishedDocuments, eventMessages, true));
scope.Complete();
}