Skip to content

Notifications: Populate IncludeDescendants on ContentPublishedNotification when publishing branch#20578

Merged
Migaroez merged 1 commit intov13/devfrom
v13/bugfix/populate-include-descendants-when-publishing-branch
Oct 22, 2025
Merged

Notifications: Populate IncludeDescendants on ContentPublishedNotification when publishing branch#20578
Migaroez merged 1 commit intov13/devfrom
v13/bugfix/populate-include-descendants-when-publishing-branch

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Resolves: #20575

Description

This looks a fairly straightforward oversight and fix - we have IncludeDescendants on ContentPublishedNotification but aren't currently populating it when publishing a branch as the wrong constructor is being called.

Testing

Can use the following notification handler and composer for testing.

using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;

namespace Umbraco.Cms.Web.UI.Custom;

internal class MyContentPublishedNotificationHandler : INotificationAsyncHandler<ContentPublishedNotification>
{
    private readonly ILogger<MyContentPublishedNotificationHandler> _logger;

    public MyContentPublishedNotificationHandler(ILogger<MyContentPublishedNotificationHandler> logger) => _logger = logger;

    public Task HandleAsync(ContentPublishedNotification notification, CancellationToken cancellationToken)
    {
        _logger.LogInformation($"PublishWithDescendants: {notification.IncludeDescendants}");
        return Task.CompletedTask;
    }
}
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Notifications;

namespace Umbraco.Cms.Web.UI.Custom;

public class TestComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.AddNotificationAsyncHandler<ContentPublishedNotification, MyContentPublishedNotificationHandler>();
    }
}

Copilot AI review requested due to automatic review settings October 20, 2025 17:52
@AndyButland AndyButland changed the title Notification: Populate IncludeDescendants on ContentPublishedNotification when publishing branch Notifications: Populate IncludeDescendants on ContentPublishedNotification when publishing branch Oct 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where the IncludeDescendants property on ContentPublishedNotification was not being populated when publishing a content branch. The fix ensures that the notification correctly indicates when descendants are being published as part of a branch publish operation.

Key Changes:

  • Updated the ContentPublishedNotification constructor call in SaveAndPublishBranch to pass true for the IncludeDescendants parameter

Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't think of any sideffects. Good to go 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants