Make the "Publish" and "Publish with decendants" behaviour and notifications consistent #19015
Replies: 3 comments
-
@AndyButland @Zeegaan @shearer3000 @Rockerby @bkclerke Hi guys, any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
Cheers for the detailed discussion @kieron-mcintyre ! Not sure I agree that a setting on what to do here is the way forward, but I totally agree with the need for consistency. If I came into this fresh, knowing nothing about it, I would expect the same behaviour from clicking "publish" on a node as I would do triggering the publish from one of it's ancestors. I.e. audit trail, republish, events, index rebuild. Even down to the republishing of content (maybe a "this can be a super heavy operation" warning wouldn't go a-miss!) |
Beta Was this translation helpful? Give feedback.
-
@Rockerby Thanks for the feedback mate. The challenge here I believe is that we aren't going to get consistency in behaviour from Umbraco as a default. There are too many projects in existence that are built upon the current way of delivering notifications. To introduce consistency would be to knowingly break everyone's sites, and that would upset a lot of people. My idea of a config setting is to mitigate against this. Using the setting, developers (rather than editors) can opt in to the behaviour they want, with the default being the current behaviour. I think it's also important to draw the distinction that this is a developer feature, not an editor feature. |
Beta Was this translation helpful? Give feedback.
-
The problem
The behaviour around publishing is inconsistent and the notifications that are raised as a result are also inconsistent. This is partly related to the decision in 13739 to roll back the feature, which I agree with - the feature wasn't solving the issue.
An example
Consider node X in the content structure that is published and that has descendants A, B, C and D, all of which are also published.
a) If I click "Publish" on node X, it will:
ContentPublishingNotification
containing a single entity for X in thePublishedEntities
collectionContentPublishedNotification
containing a single entity for X in thePublishedEntities
collectionb) If instead, I select "Publish with Descendants" on the same node, it will:
ContentPublishedNotification
containing an emptyPublishedEntities
collection.No
ContentPublishingNotification
is raised and it is not even possible to know what triggered the action because thisPublishedEntities
collection is empty.This has been the behaviour in Umbraco for a long time so I am not expecting it to change. However, it is inconsistent and makes it difficult to respond to actions taken in the backoffice.
A solution
I suggest that a
Umbraco:CMS:Content:PublishBehaviour
setting is introduced in the appsettings that allows:AlwaysRepublish
- "Publish with Descendants" to always republish everything and raise both Publishing and Published notifications, both including X and descendants A, B, C, and D in thePublishedEntities
collection;AlwaysNotify
- "Publish with Descendants" maintains existing publish behaviour but raises both Publishing and Published notifications, both including X and descendants A, B, C, and D in thePublishedEntities
collection;Default
- No changeWith no value set, the default would be the existing behaviour. The decision can then be made by the developer.
Also ...
I would suggest that:
When
Default
is selected, if a node has no changes either the "Publish" button is greyed out or clicking it doesn't republish or raise notifications. This would provide the consistency between the options.New
ContentRepublishingNotification
andContentRepublishedNotification
classes are made available for whenDefault
orAlwaysRepublish
modes are selected.Beta Was this translation helpful? Give feedback.
All reactions