Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • João Roque 11 posts 95 karma points
    Aug 30, 2021 @ 11:31
    João Roque
    0

    Changing property in PublishingNotification prevents publishing

    I'm subscribing to the PublishingNotification with a class overriding INotificationHandler as is explained in the documentation.

    I'm doing so because I need to create a row on my internal database for the node being published and then associate that new row primary key (id) back in the Umbraco node.

    What happens is when I set the value of a node's property to anything different than it was, the node is saved with the new value in that property but the publishing is canceled. If I don't change the value the publishing happens as expected.

    The property is of type "label (int)" and I'm using the following code:

    var categoryNode = notification.PublishedEntities.FirstOrDefault(x => x.ContentType.Alias == "categoria");
    categoryNode.SetValue("dbId", dbId);
    

    Is this by design? If so, how can I force the publish to happen even if I change something?

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft