Unpublishing multi-language nodes - no ContentUnpublishedNotification until last language
Hi,
When clicking "Unpublish" and selecting one the available cultures of the node, no ContentUnpublishedNotification will be caught in my handler until the very last culture is unpublished.
No notification sent once the first 2 cultures are unpublished:
Once the last culture is published, a notification is sent:
How do I find out a culture has been unpublished then?
Is there a different notification for culture modifications?
Unpublishing multi-language nodes - no ContentUnpublishedNotification until last language
Hi,
When clicking "Unpublish" and selecting one the available cultures of the node, no ContentUnpublishedNotification will be caught in my handler until the very last culture is unpublished.
No notification sent once the first 2 cultures are unpublished:
Once the last culture is published, a notification is sent:
How do I find out a culture has been unpublished then? Is there a different notification for culture modifications?
Hi NSC
Yes the ContentUnpublished notification only fires when the entire document is unpublished, if a culture remains then part of it is still published..
There is though, a set of extension methods:
https://github.com/umbraco/Umbraco-CMS/blob/0edee82b0b92876ef336a04fa82eb48832302523/src/Umbraco.Core/Notifications/ContentNotificationExtensions.cs#L34
Which you can access during a 'publishing notification' to determine whether the publishing has been triggered by the act of u publishing a culture...
(it's a bit counter intuitive but unpublishing a culture needs to update the published cache, and therefore triggers the publishing notifications)
So you can check in the publishing notification using HasUnpublishingCulture and then use IsUnpublishingCulture to determine which one...
Regards
Marc
is working on a reply...